I am integrating BC and Sales CRM. Currently, I have created a custom table mapping and field mappings to the custom table in CRM. The manual sync works fine. All data can be synced as expected.
Now I want to automate this process. I want to create a custom Job Queue entry to the scheduled sync through AL extension.
Can you please guide me how to do this?
There is a standard function on the "CRM Setup Defaults" table named "CreateJobQueueEntry". You only need to call this with your Integration Table Mapping record and it will create it for you. This should be set when you create the record via the events for the default setup.
Thanks Jon for your response. As I use it directly as you have suggested, I am getting the following message while running the Default Sync setup and the job entry not getting created. That was the reason, I recreated the method and call it to create the job queue entry and it works fine.
The following AL methods are limited during write transactions because one or more tables will be locked: Form.RunModal is not allowed in write transactions. Codeunit.Run is allowed in write transactions only if the return value is not used. For example, 'OK := Codeunit.Run()' is not allowed. Report.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'Report.RunModal(...,false)' is allowed. XmlPort.RunModal is allowed in write transactions only if 'RequestForm = false'. For example, 'XmlPort.RunModal(...,false)' is allowed. Use the commit method to save the changes before this call, or structure the code differently. Contact your application developer for further assistance.