Property Creation

Tanisha26
Tera Contributor

How to create a property which captures current date and should be updated each time we run a job

1 REPLY 1

Harish KM
Kilo Patron
Kilo Patron

Hi @Tanisha26 you want to capture the run time of schedule job and save it in a system property? If yes then use below code in schedulejob script:

1. create a property with type as date format

 

var prop = new GlideRecord('sys_properties');
prop.addQuery('sys_id','1d8b617697b84610f633fb200153af98'); //property sysid
prop.query();
if(prop.next())
{
    prop.value = new GlideDateTime();
    prop.update();
}
Regards
Harish