- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-30-2023 01:56 PM - edited 10-30-2023 01:59 PM
No matter how you twist it, if you have to use current.update(); or .setWorkflow(), you are doing it wrong.
The are several options to do it better, but for sure you need at least two business rules: one that creates the parent and another that updates back the parent's unique value (sys_id) on the original Case.
E.g:
- establish a flag field (even create a new reference field on task*, like "Parent of" or "Created from" reference)
- 1st (after or async) business rule on insert creates a new cases if the flag field is empty
- 2nd (after of async) business rule on insert updates the record referenced in flag with its unique value.
Later edit:
*) on task, because such situation will for sure crop up later in case of other processes and you will be able to reuse the flag field for similar situation.