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:13 AM
Hi,
Do need to set the value of the logged in user on the filed ?
If so, then set the 'default value' on the dictionary as 'javascript:gs.getUserID()'.
PS, uncheck the 'dynamic default', and just add the 'default value'.
-Anurag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 01:20 AM
Hi,
I did what you said but I got the same error.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 01:23 AM
Can you show a screenshot of the dictionary with error?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2021 01:38 AM
Hi,
Is this happening with admin or non-admins.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader