How can I set Dynamic default value for a reference field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 01:06 AM
Hi,
I am creating a new app and it has a table that contains a reference field. The reference field's name is 'Assigned to' and it uses 'sys_user' table. I need to set 'dynamic default value'. Its label 'Sender' and its script is 'gs.getUserID();'
However it is not working and give me the error 'Invalid default value'. How can I solve this problem?
Thanks for advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 01:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 02:04 AM
On the second screenshot i see the column label being blank, that is giving you the invalid insert error.
1) clear out the value 'sender' from dynamic default value
2) Uncheck Dynamic default checkbox
3) add the default value that i gave previously to the dynamic default column(this shows up when you have unchecked the dynamic default checkbox)
4) make sure other mandatory fields on the form are filled
5) Save
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 02:11 AM
After I save the field, the column label is automatically being blank because the error. And I tried what you said before. It did not work either.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 02:09 AM
Hi,
Please follow steps mentioned by Anurag,
1st fix the Column label empty issue
Columns showing a blank or (empty) column label
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader