- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:10 AM
My requirement is to auto-populate the 'sys_created_on' in another custom field 'start date' which will be read-only on the same form only for new records. Please help me make it working.
I have a BR.
Table : User Entitlement
When to run: after
condition: start date is empty
var gDatetime = new GlideDateTime(current.sys_created_on);
if (sys_created_on==' ') {
current.u_start_date = gDatetime;
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-24-2019 07:48 AM
Hi riyak,
Notice the screenshots below
In my dev instance, the BR works correctly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:48 AM
But I want the condition to apply only on new records not for existing records. The above condition will apply to all records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:52 AM
Run BR on insert, so it will work only for new records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:54 AM
I just ran for insert, it didn't work. It's not populating the date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 08:58 AM
Is it before or after? It should be after
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2019 09:03 AM
It is after. Once the record is created, the date should be populated.