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,
BR not triggering and i added gs.info() but not working

Thanks
Krishna

Hi Ankur,

Could you please send is any way or script for achieve this requirement.

Thanks
Krishna

@Krishna101 

what's your business requirement?

As per customer requirement when should the BR trigger?

unless you configure that how would you know when it should run?

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,
Once meeting completed meeting time will capture in meeting start time field, this meeting start time value will move to  nearest cab date field in change request form.
Thanks
Krishna

@Krishna101 

then your BR should be on Meeting table

Condition: Status is Completed AND current.board_groups == '82faef5adb28cf0029253220ad96192a'

Script: Please enhance as I don't know the exact field names

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

    var chg = current.change_request.getRefRecord();
    chg.u_the_nearest_cab_date = current.start; // Replace with your field names
    chg.update();

})(current, previous);

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