- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2015 11:33 AM
Hi Berny
If I run a query that will take the sys_id of the REQ record, look at the sys_history_set. I get the relevant information i need and then try to query the sys_history_line table to return the latest close_code entry
I need to populate a field on the REQ table
When I run the query I often find lots of null entries
If I go into the record, at the bottom we see the Activity states - including the one I am searching for
If I now got back and run my query again, I now get to see the data from the sys_history_line.
It is as if I need to force the line to load to do this.
I did try against the sys_audit table and got a similar problem
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-15-2015 06:25 PM
Hi Julian, I now understand what you're looking for. Indeed it's odd how records get added to the audit / history tables. The good news is that there is a work around.
On your case you can create an Insert / Update OnAfter business rule in the change_request table and have a script like the following:
new GlideHistorySet("change_request", current.sys_id).generate();
That will make the trick
Thanks,
Berny
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-10-2018 04:32 PM
This function is amazing, thanks for sharing the info!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2015 01:10 AM
I shall have a look at this a little later this week
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2015 10:16 PM
Sounds good Julian!
The business rule is really straight forward (since it's just one line of code). Please let me know if you run into any issues or if you have any further questions.
Thanks,
Berny