Default value for a reference field on UI page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2023 04:31 AM
How to set a particular caller name as default value in Caller field(reference) on an incident form UI page.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2023 04:55 AM - edited ‎03-23-2023 05:01 AM
Step 1: Right-click on the field label, and select configure dictionary.
Step 2: In the Default Value section, uncheck "Use dynamic default" and enter the sys id of the user you want to have as default on the caller field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2023 05:24 AM
Hi Nalin,
My default value should be only for the incidents on my UI page in Analyst workspace. Remaining incidents in other views need not have this value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-23-2023 09:49 AM
Hi @Swetha M
There are 3 way to do this.
1) Dictionary default value
javascript: gs.getUserID();
OR
2) On load client script on that table
function onLoad(){
if(g_form.isNewRecord()){
g_form.setValue('caller_id', g_user.userID);
}
}
OR
3) Display business rule on that table
(function executeRule(current, previous /*null when async*/) {
if(current.isNewRecord())
current.caller_id = gs.getUserID();
})(current, previous);
Thanks
praphul kumar pandey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2023 08:49 PM
@Ankur Bawiskar any advice on this??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-26-2023 09:39 PM
Can you share your business requirement here?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
