
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2018 10:42 PM
Hi,
I try to query the sys_audit table to get an old value from a specific field. My proble is the documentkey field. In this field is stored the sys_id from the record. When I use the sys_id directly, I got my result. When I use g_form.getUniqueValue(), I got no result. I use this code:
//var dockey= 'c623ccd3db625bc4dcaefe9b0c961958'; (sys_id from the record)
var dockey = g_form.getUniqueValue();
var olddx = new GlideRecord('sys_audit');
olddx.addQuery('tablename', 'u_kodak_dx_numbers');
olddx.addQuery('fieldname', 'u_location');
olddx.addQuery('documentkey', dockey);
olddx.query();
while(olddx.next()) {
alert(olddx.oldvalue + ' dx audit');
}
Have anybody an idea where my mistake is?
Best regards
André
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2018 11:26 PM
Ok. You can easily do that using an After update business rule.
For ex if you changed the location, you can use
gs.addInfoMessage('+++current location++++'+current.u_location);
gs.addInfoMessage('+++old location++++'+previous.u_location);
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2018 11:26 PM
Ok. You can easily do that using an After update business rule.
For ex if you changed the location, you can use
gs.addInfoMessage('+++current location++++'+current.u_location);
gs.addInfoMessage('+++old location++++'+previous.u_location);
Please mark this response as correct or helpful if it assisted you with your question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-28-2018 11:38 PM
it works! Thanks a lot!