how can we update sys_properties value when ever a record is inserted
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 06:50 PM
I want to update sys_property.list value when ever a new record in inserted or deleted from a table. Is is possible to achieve?
Need your valuable suggestions
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 06:58 PM
HI Teja
You can write a business rule after delete and insert and do the GlideRecord on sys_properties table. Add the addquery using the name of the property and update the value accordingly.
-harsh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 07:07 PM
sample code please so that I can modify accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 07:15 PM
add below script in business rule which should run after insert and after delete
var Pname = ""; // put the name of your property
var Pvalue = ""; // put the new value here
var gr = new GlideRecord('sys_properties')
gr.addQuery("name="+Pname);
gr.query();
if(gr.next()){
gr.value = Pvalue ;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-10-2017 08:20 PM
Thank you let me try