how can we update sys_properties value when ever a record is inserted

Raviteja K
Tera Expert

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.

6 REPLIES 6

HarshTimes
Tera Guru

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


sample code please so that I can modify accordingly.


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();



}


Thank you let me try