Notify and dispatch jobs with Skedulo API using Salesforce
Notification inputs are used for all API requests that dispatch job notifications to resources and are defined in the following way:
global Notification(Id jobId, Id resourceId)
- Log in to your Skedulo account in Salesforce.
- Create a new job, or find the
jobIdof a job that you want to dispatch or send a notification to the resource.
- Open the Developer Console. a. Click the Settings cog in the upper-right corner. b. Select Developer Console.
- Select Debug -> Open Execute Anonymous Window, or press Ctrl + E.
Enter the following code using the correct
jobIdto dispatch the job and notify the resource.
sked.ApiInput.Notification input = new sked.ApiInput.Notification('<jobId>', null); System.debug(sked.SkeduloAPI.dispatch(input));
Select the Debug Only filter in the Execution Log and open the
USER_DEBUGevent to view the log and confirm the job has been dispatched.
If the job has been despatched correctly, the log results should display the
resourceId and method of notification, with no errors, for example:
14:20:22:372 USER_DEBUG |DEBUG|Notification:[jobId=a0G2v00002YM4OVEA1, results=(ResourceNotification:[error=null, protocol=sms, resourceId=a0X2v00000MKTovEAH])]
Logs that show no results (
results=()) or an error message have not dispatched correctly:
14:06:24:900 USER_DEBUG |DEBUG|Notification:[jobId=a0G2v00002YmO4dEAF, results=()]
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.