Trigger business rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-08-2023 08:27 PM
Hello All,
I need to trigger the business rule if there is any insert or update happens to sc_task table. But if only attachment is getting inserted then the business rule is not getting triggered.
And if I write the business rule for sys_attachment table and for sc_task table. Then if there is any update to the fields and attachment insert at same time from REST, then it is getting triggered two times. One from sys_attachment and one from sc_task.
How can I handle this if there is any insert to the table with attachment by REST then it should trigger only one time
Kindly help me for the solution

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2023 02:24 AM
Out of curiosity I tried this, and I'm sad to say, that it doesn't work as I intended it to.
The problem is that in scenario 3, the update of the two different records happens independent of each other, and there is no way to determine if the two updates belong to each other or not.
I guess you can elaborate with some kind of event trigger kind of solution, but then the issue will always be when it should be considered a new event, or an event is already in progress (two updates happening in close proximity).
A totally different approach would be to run a scheduled Flow (or scheduled job) every two minutes (or how often you require) and check for all records that has been updated within the last two minutes, and run your logic there. This solution would still require that you update the sc_task record whenever an insert (or delete) happens on the sys_attachment table that affects a sc_task record.
Let me know if you want to explore these options, or require additional help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-09-2023 11:58 PM
@OlaN It makes sense ,agree this approach will work triggering flow with delay some time that will work.