Update a record without updating its system fields(like sys_updated_by) from workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 12:54 AM
How can we update a record without updating its system fields(like sys_updated_by)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 05:43 AM
Hi Prudhvi,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 05:54 AM
Hi Prudhvi,
There are two options as mentioned below:
1- You can use current.autosysfields(false) to skip the update of system fields.
2- You can use below code snippet and modify accordingly:
var target = new GlideRecord("table_name");
target.get("sys_id");
target.setValue('field_name', new_value);
target.execute(); or target.update();
Hope this will resolve your issue
Regards,
Shashank
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 06:30 AM
describes the use of 'autoSysFields()'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-01-2023 07:17 AM
Yes for skipping the update to system fields use autosysfields(false) as mentioned by Shashank. If you need help with entire code please post the snippet here.
Thanks,
Badal.