Background script to update date field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2021 02:58 AM
Hello!
I need to update the retirement date of assets with a specific date using background script. This is my script but it does not work.
var gr = new GlideRecord('clm_m2m_contract_asset');
gr.addEncodedQuery('<insert query>');
gr.query();
while (gr.next()) {
gr.retirement_date = '2022-01-30';
gr.setWorkflow(false);
gr.update();
}
Please help!
Thanks.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2022 04:49 AM
Hope you are doing good.
Did my reply answer your question?
If my response helped you please mark it correct to close the question so that it benefits future readers as well.
Regards
Ankur
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader