Hello,
I’m currently working on a usecase wherein I need to insert some records in Custom Objects daily. In order to achieve this, I have created a workflow with Custom Code action added in it. I need to execute this workflow on dailty basis to delete existing records and push fresh records daily.
Custom code action is responsible for following actions:
1. Get the list of records from custom object and form a data structure to delete existing records after insertion of fresh records.
2. Insert fresh records in Custom Object.
3. Delete the pre-existing records using data structure created in step#1.
After scheduling the workflow to execute daily the behavior of workflow is very diasy. I’m facing following issues:
1. Sometimes the workflow doesn’t get executed at all at the scheduled time.
2. The code for deletion takes place fine , but during insertion it inserts the same set of data multiple times. This behavior is a bit abnormal as sometimes the insertions works correct and sometimes it inserts multiple times.
Any leads on resolving these issues would be very helpful. Thank you in advance.
Best Regards,
Swapnil