- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2017 10:02 AM
I have a requirement to reproduce the functionality of the Activity formatter in a portal we are creating. I need to make API calls to capture the audit history for changes made to the additional comments and state fields. My question is should I be concerned with querying the sys_history_line table to retrieve this information? I am just looking for some best practice guidance here. Thanks in advance for any advice you can offer.
Solved! Go to Solution.
- Labels:
-
Best Practices
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2017 09:13 PM
Hi Bobby,
sys_history_line is generally a large table and the queries against it comes with a cost!!.
however, make sure to have sysparm_record_count to limit your results :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2017 09:13 PM
Hi Bobby,
sys_history_line is generally a large table and the queries against it comes with a cost!!.
however, make sure to have sysparm_record_count to limit your results :
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2017 08:32 AM
Thanks for the feedback Srinivas we are actually going to perform a few tests. The developer of our portal is looking into limiting the pull to 10 records at a time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2018 07:03 AM
Hello,
The sys_history_line table is a big table and i think is getting rotated. That means, sometimes you are searching for a specific record and is not there.
I found the following code:
var hs = new GlideHistorySet(glideRecord);
var hs_sys_id = hs.generate();
Where "glideRecord" the Glide Record you are searching it's history lines.
These two lines of code will force the system to "pop-up" the records in the sys_history_line table that are related to your record.
I hope that helps.