Business Rule on History Table (sys_history_line)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2018 10:03 AM
Hello Guys,
I´m considering to create a Business Rule on History (sys_history_line) table, for when a specific record will inserted in this table I will create a record in another table.
But apparentely Business Rules doesn´t work for this table.
History LInes are created when I run this script for example
var gr = new GlideRecord("u_desktop");
gr.addQuery('name', 'AR00002713');
gr.query();
if ( gr.next() ){
new GlideHistorySet("u_desktop", gr.sys_id).generate();
}
I think that is because we cannot use Business Rules in some system tables, am i right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2018 10:30 AM
Hi,
Create a Business Rule as mentioned in below(It is an example only). It may help you.
When to Run: After Insert
(function executeRule(current, previous /*null when async*/) {
var target = GlideRecord('target_table_name');
target.initialize();
target.record1=current.record1;
target.record2=current.record2;
target.record3=current.record3;
target.record4=current.record4;
target.insert();
})(current, previous);
Thanks,
Harish.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2018 12:07 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2018 12:40 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-01-2018 01:21 PM