I want to populate RITM "state" field value based on state field value of ctask
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 03:01 AM
I am trying to write on after(when updated) BR on "sc_task" table to opulate RITm state field based on the ctask state field. ie., if ctask state is "work in progress" then it should be same for ritm state . this should be applicable only forthe catalog item i created.
What should I write in the scripting. Kindly guide.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-22-2024 03:13 AM
Is the 'cat_item' field on your sc_task record filled?
Next to that: use the flow designer. You can do the same without any scripting. You do need to validate if the states are the same between the records, so you can map all states.
Also: really reconsider this requirement. It will limit you to only use one task now, and in the future when something may change about the setup. Because if you have one task that goes to complete, it closes the RITM and a second task won't do a thing anymore (or conflicts between two tasks in different states). Please look at the 'why' of your requirement. Does it really justify to do this for only one catalog item?
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2024 02:31 PM
This is a bad idea, catalog tasks and RITMs should ideally be controlled by flows, this is likely an xyproblem, what are you really trying to accomplish?
As Mark explained, if you set the RITM state based on the sc_task state, once the sc_task is done the RITM will also be marked as complete. Instead you should control the RITM state in the flow, so that when the flow is complete, the last flow action should be to set the state of the RITM to complete, or even to just set the stage to "complete" which will set the state to "Closed Complete" (and will also close the REQ).