Auto Populate date and time field value from anothe table date time field value

Krishna101
Tera Contributor

Hi Everyone,
Good Day!
I have field as near_meeting_date (Field type as Date/Time) in change request table and having another field
as meeting_start_date (Field type as Date/Time) in meeting table, I want to auto populate nearest date value of meeting_start_date  to 'near_meeting_date' in change request form. Could you please give suggest how we can get this requirement.
Thanks,
Krishna

20 REPLIES 20

Hi Ankur, done but no luck

@Krishna101 

Sorry but you are not sharing your BR screenshots, you are not sharing what debugging have you done.

We don't have access to your instance to know the field names etc, we can't debug as well.

We in community can guide you in a direction and may not be able to complete the requirement.

The scripts we share should be a starting point for you to enhance on top of it and achieve your requirement.

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

HI Ankur,

Krishna101_0-1755688730296.pngKrishna101_1-1755688787588.png

Before Business Rule in change request form

Krishna101_2-1755688901488.pngKrishna101_3-1755688944430.png

After Business Rule in Cab meeting table

Krishna101_4-1755689005022.pngKrishna101_5-1755689040274.png

Please check both business rules, both are not working,Please assist on this
Thanks
Krishna

@Krishna101 

Why you want 2 business rule?

You want the date to be populated when CAB meeting is completed, so only BR on CAB meeting table is required.

Did you check the other BR and debug by adding logs?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Hi Ankur,
I disable the bR in change request, now on ly BR actiove in meeting table

(function executeRule(current, previous /*null when async*/) {

    var chg = current.change_request.getRefRecord();
    chg.u_the_nearest_cab_date = current.start;
    chg.update();

})(current, previous);
I did n't get any logs on this, not working this script
Thanks
Krishna