Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Set the default value for reference filed

sivananda80
Tera Expert

Hi all,

I have felid(u_group_schedule).I need default value(24*5).This filed reference from cmn_schedule table.

Can u help me on that

Thank you

16 REPLIES 16

Hi Jan,

Thank you reply,

I am using sys_id for default value it's not getting result.

Thank you.

find_real_file.png

Hi Dan,

Thank for reply using the sys_id ,But I am not getting result ,

Thank you.

Did you copy the correct record sys_id which refers to schedule table?

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

Yes Ankur

Ankur Bawiskar
Tera Patron

Hi,

it is not recommended to hard-code sys_id

1) create system property of type string and store the sys_id of 24*5 in it

find_real_file.png

2) then in the default value use this script

javascript: gs.getProperty('schedule_sys_id');

Regards
Ankur

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