Property Creation
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 12:50 AM
How to create a property which captures current date and should be updated each time we run a job
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-11-2024 01:07 AM - edited ‎03-11-2024 01:15 AM
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
Harish