- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 10:33 PM
HI Sir,
I want to update multiple records in the HR case to closed complete but the script is not running , i am getting a correct getRowcount = 3 but it not working . I have used both update() and updateMultiple().
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 11:09 PM
Hi @chandan31,
Semi-colon was missing at addQuery line. updated the scripts. please check and let me know.
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍🏻
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 10:43 PM - edited 08-30-2023 11:08 PM
Hi @chandan31,
Try this updated scripts.
var gr = new GlideRecord('sn_hr_core_case');
gr.addQuery('hr_service=9ecf515587f7019449e4c8cf8bbb35ea^state!=3');
gr.query();
while (gr.next()) {
gs.info('chandan_test' + gr.getRowCount());
gr.state = '3'; // make sure value is correct
gr.update();
}
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍🏻
Thanks,
Sagar Pagar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 10:46 PM
In the Place addQuery it should be addEncodedQuery
Is it correct?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 10:51 PM
This script is not running.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 11:09 PM
Hi @chandan31,
Semi-colon was missing at addQuery line. updated the scripts. please check and let me know.
If my response helps to solve your issue. Kindly mark it as helpful & correct. It will be helpful for future readers! 👍🏻
Thanks,
Sagar Pagar