Service Help – SchedulerTaskPost
The Sharperlight service offers a wide variety of presentation methods, each with its own set of parameters.
In this post, we will introduce the following method from among the various presentation methods available.
http://abcd.com/mdService1Rest/SchedulerTaskPost/…
{sharperlight service url}/Help#SchedulerTaskPost
|
Execute a Scheduled Task on the Server with parameters on the URL string To override any Task parameters use the format p1=taskCode:OverrideValue&p2=taskCode:OverrideValue to p(n) where the number is the position of the parameter in the list Note: The Task is executed asynchronous/out of process so you will not get a response when it’s complete A response JSON status is returned there is an basic validation error like task not found The reason there is no complete status returned is because the tasks may take a very long time to complete. If you want to know the progress or final status of the task execution then you can query/poll the System / Scheduler History Table In this way you can check to see if any errors or complete records have appeared. The task can create custom entries in the History Log Table with details that can give feedback to this process. NOTE: What type of user account the task runs as is important and if not set correctly may cause the task not to run or run with the wrong row level security
http://sharperlight-my/mdService1Rest/SchedulerTask?task=MyTaskCode&response=json&callback=MyFunc&p1=code1:value1&p2=code2:value&usid=feb73c8c0e9c41989da001ea86c15e5aZ
or if you want to target another Service
http://sharperlight-my/mdService1Rest/SchedulerTask?task=MyTaskCode&service=PROD2&response=json&callback=MyFunc&p1=code1:value1&p2=code2:value&usid=feb73c8c0e9c41989da001ea86c15e5aZ
DEFAULT Status
{ “errorMessage”:”Invalid Task Code Email.Sales” }
ACCEPTED STATUS
{ “statusCount”:0 }
JSON Callback Status
ERROR STATUS
MyFunc( { “errorMessage”:”Invalid Task Code Email.Sales” } );
ACCEPTED STATUS
MyFunc( { “statusCount”:0 } );
|
|
| task=[taskCode] | The Scheduler unique task code e.g. &task=Email.Sales |
| service=[serviceCode] | If there are multiple Remote Connections to various Service you will need to set the Service code to target e.g. &service=002 |
| p(n)=[value] | Scheduled task may have parameters defined. You can override these by the position number in the list e.g. &p3=2018-09-23 |
| pwd=[codeOrEncrtped] |
The Scheduler Task may be protected with a password in the Task Parameters – Allow Query Execution section use the &pwd=xxxxx url parmameter to set the password – It can be obfuscated by encoding the password as base64 or Tripple DES encrypt it using the Task unique code or Author as the DES password e.g. &pwd=23kds53ss |
| usid=[sessionid] | User Session ID |
| response=[default|json] | The format of the response e.g. &response=json |
| callback=[funcName] | The Javascript JSONP callback function name (optional) e.g. &callback=TaskDone |
| messageOK=[value] | Override the Message format so that your own text is displayed e.g. &messageOK=Done |
| messageError=[value] | Override the error Message format so that your own text is displayed if an error occurs e.g. &messageError=Failed |
| messageTitle=[value] | Override the Message format so that your own text is displayed (Title above message) e.g. &messageTitle=Status |
