- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 08:01 AM
Hi,
I have a loop generating tasks based on a record in a custom table.
The record in the custom table is generated by a previous task activity.
The record is associated so it can bee seen in related list to the task that created it.
so then the loop runs, and for every new record created...It creates a new task!
I want the record to be updated with the new task creation, instead of the old one...but the task doesnt exist till I create task, and once im in the task, I cant really update the record while it waits for task completion.
any elegant ideas to get around this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 06:21 AM - edited 12-03-2024 06:25 AM
Thanks @Brad Bowman for the help. I have however, sussed it. I knew there was a simple solution somewhere. Kicking myself once I stared blankly at the screen long enough for the solution to manifest to me.
Its this (in case you need it or anyone else in the future)
Obvious really!
1. Do NOT!!! set the task to wait for completion.
2. update the other record
3. Set a wait for condition on the task in 1...state=closed.
slaps own forehead!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-02-2024 09:08 AM
Are you using a Business Rule, flow (designer), or workflow (legacy) for this? It sounds like in the script that is creating a new task, the next step would be to update the record. What is the obstacle to doing that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 02:46 AM - edited 12-03-2024 02:53 AM
It's flow designer...sorry I thought I had said, which is why there's an issue.
Flow designer "create task" has the wait for complete option....which I need for the flow. and the chicken and egg scenario is, that I cant update the newly generated task sys_id to the already existing related records field until the task is generated. but I need the related record visible in the task for the "taskee" to know which record to do the task on.
flow like this..
Task1 user to create a new custom record on table x.
x record on custom table has a field "Parent Task" containing Task 1.
Task 1 closed complete
Task 2 generate, user to act on information in record x....but record x is still in task 1s related list, I need to update the field "parent task" to now show task 2 as its parent record.
But until task 2 is generated to provide sys_id, I cant update Recordd x with its new parent id. once flow generates task 2, its stuck there until task 2 is complete, due to wait for complete. with no clean alternative.
I have considered a branch, a wait timer and then a lookup....but that seems very overkill and untidy for a simple need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 04:53 AM
You can create a Business Rule on whatever table Task 2 is created on, after Insert, with whatever Filter Conditions make sense to only run when this task is created - maybe a certain Short Description that you are setting when creating the task. The script will do a GlideRecord on the custom record table, with an addQuery line for parent task = task 1 or whatever links the two in your scenario then updates the field to the current sys_id.
In the out of box Service Catalog scenario for an example, the BR would be on the sc_task table, querying the sc_req_item table to find one under the same related sc_request record, updating the request_item field on the sc_task record to associate it with a different RITM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-03-2024 05:41 AM
Thanks I can see that working, but it seems awfully cumbersome, for a record whose details totally exist in the flow already.