Script actions run as system
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 01:53 AM
Hi All,
I have created a script action when it runs all the updates which run by script action is showing as "System".
Is there any way to show particular user name?
Thanks in advance,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 02:00 AM
If you're adding comments you can set the author of the comment by using setJournalEntry eg:
gr.comments.setJournalEntry('this is a comment', 'Users Name');
For other things, i've had some success with using GlideImpersonate, basically impersonating a session with a different user before making the update, worth a try:
var impUser = new GlideImpersonate();
impUser.impersonate('sys_id of user');
gr.insert()/gr.update()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 05:01 AM
Hi,
Thanks for information.
If i add code like below it will work.
rec.sys_updated_by = "CMD";
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 06:51 AM
Try it out and see! I'm not going to test it for you 🙂
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-27-2019 05:02 AM
Hi,
Thanks for information.
If i add code like below it will work? Please confirm.
rec.sys_updated_by = "CMD";
Thanks,