- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2022 10:12 PM
1) when i update the state of sctask to any, then I need to update the state of RITM and REQ and Universal request too?
2) When I update the work notes or additional comments of sctask it should update on RITM and on Universal request too?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-17-2022 03:10 AM
It's working now like this
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var closedCompleteCount = 0;
var closedInCompleteCount = 0;
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.request_item);
gr.query();
var totalCount = gr.getRowCount();
while(gr.next()){
if(gr.state == 3){
closedCompleteCount++;
}
if(gr.state == 4){
closedInCompleteCount++;
}
}
var ritm = current.request_item.getRefRecord();
var req = current.request.getRefRecord();
if(totalCount == closedCompleteCount){
ritm.state = 3;
ritm.update();
req.state = 3;
req.update();
}
if(closedInCompleteCount > 0){
ritm.state = 4;
ritm.update();
req.state = 4;
req.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-12-2022 01:21 AM
Make sense of your situation, would you say you are attempting to mechanize this or you are finding out if it ought to work that way?
Go ahead and mark right, Assuming I addressed your question. <a href="https://axolotlsquishmallow.com/products/cow-squishmallow">strawberry cow squishmallow</a>
Will be useful for future guests searching for comparable inquiries 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2022 12:35 PM
Thanks for sharing such a wonderful inforation here. it help me a lot. Thanks again rosa's breakfast time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-07-2023 10:27 AM
Thanks for sharing such a wonderful information here, it help me a lot. Thanks again Cowsquishmallow