- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-25-2017 01:15 AM
Hi friends,
Have a basic question. how to create records with system as the user name. There are few places where i need to create records with some common names ... but dont want any specific login name on Public UI pages...
can you please help me with an example if possible! thanks a lot;!!!!
Best Regards
Rahul N
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2017 03:40 PM
Hi Rahul,
If I understand your requirement, you need to override the created_by value with 'system' and other values like sys_created_on..etc to be kept as they come from the external system. Please correct me if I am wrong. This is not very ideal to do from the 'Audit' perspective. Technically you can achieve this using as shown below.
var gr = new GlideRecord('incident');
gr.addQuery('number', 'INC1234567');
gr.query();
if(gr.next()){
gr.sys_created_by = 'system';
gr.sys_created_on = inputDate;
gr.autoSysFields(false);
gr.update();
}
Hope this helps. Mark the answer as correct/helpful based on impact.
Thanks
Antin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2017 03:40 PM
Hi Rahul,
If I understand your requirement, you need to override the created_by value with 'system' and other values like sys_created_on..etc to be kept as they come from the external system. Please correct me if I am wrong. This is not very ideal to do from the 'Audit' perspective. Technically you can achieve this using as shown below.
var gr = new GlideRecord('incident');
gr.addQuery('number', 'INC1234567');
gr.query();
if(gr.next()){
gr.sys_created_by = 'system';
gr.sys_created_on = inputDate;
gr.autoSysFields(false);
gr.update();
}
Hope this helps. Mark the answer as correct/helpful based on impact.
Thanks
Antin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2017 11:34 PM
thanks antin!!!!! exactly what i was asking help. please explain the audit issues??
Best Regards
Rahul N

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2021 07:57 PM
Hi Antin,
I have done this way earlier but the ask is if you go for audit logs apart from sys_created_by all other places it shows as Original user name due to whom the BR was triggered.
Is there a way to show the BR is executed by System.
Regards,
Imran