- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2016 04:30 AM
Hello.
GlideRecord wiki page tells
public string update(Object reason)
Parameters: reason - Takes a string designating the reason for the update if necessary. The reason will be displayed in the audit record.
So what is right way of providing reason?
Neigher
var gr = new GlideRecord('alm_hardware');
gr.get('0034748c0ffc02003685ee68b1050e70');
gr.setForceUpdate(true); //just to make sure
gr.comments = 'test123'
gr.update("reason text her")
no
var gr = new GlideRecord('alm_hardware');
gr.get('0034748c0ffc02003685ee68b1050e70');
gr.setForceUpdate(true); //just to make sure
gr.comments = 'test1232'
var reason = {'reason' : 'some reason here'}
gr.update(reason)
works for me.
Thanks.
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-21-2016 07:07 AM
Both hard-coded strings and string variables will work (although your first example is not a string but a JavaScript object). However, the reason is NOT added to the History table (sys_history_line), which the Activity Formatter uses to display in the form, but it is added to the Sys Audit table (sys_audit), which is not really shown anywhere. You'll probably have to personalize your list view to add the Reason column.
It's definitely a little misleading.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 03:45 AM
Thank you. This information is very helpful. Btw do you know why there is no "Correct answer" button so i can't mark your post with it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 04:01 AM
click on the below link to find it.
What is right way of providing update reason?
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
Thanks,
Deepa
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 10:30 AM
Looks like the post was not originally marked as a question. I think dan.bruhn can help with that.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-22-2016 10:38 AM
Hi Jim,
I went ahead and updated the thread.
Thanks,
