- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 04:13 AM
We create Demand [dmn_demand] record, then create enhancement [rm_enhancement] record from the demand record. the demand state changes to Approved once enhancement is created.
My request is when we close enhancement record, update the demand state to Complete.
Any help/thoughts is be appreciated!
Regards
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2024 12:39 AM
The flow should look like this:
And if you insist on using a BR, why not make it simple? Trigger it after update of the enhancement with state = closed and use this:
var demand = new GlideRecord('dmn_demand');
demand.addQuery('enhancement',current.getUniqueValue());
demand.addActiveQuery();
demand.query();
while(demand.next()){
demand.setValue('state', 9); // completed
demand.update();
}
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
03-25-2024 05:28 AM
You need to create the BR after insert.
Here is baseline code for Inc and task:
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 06:09 AM
Thanks AG,
I followed the link but did not work. i think i missed something in my script can you take a look a it. see attached.
i created after update BR on Enhancement table with condition: state changes to closed complete.
script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 10:07 AM
I am not a coder 😞 , so cant help much.
@Mark Manders what you say.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2024 04:26 AM
Unsure why you want to go for a BR, when it's so easy to just drag and drop in a flow, but since it looks like you are set on the BR: try running it before instead of after, or change the condition to 'is completed' when you want to run it after.
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark