- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 12:43 AM
How to populate the current logged in user to caller field if no value present.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-04-2018 02:06 AM
Hello,
the initialization of the default value for the caller field auto populate the caller field when a new incident is inserted.
I assume that your use case is when an existing incident is existing and for an unknow reason, the caller field is empty ... That shouldn't happen if you set the caller field mandatory ...
To give you the technical answer, please find below the client script code :
function onLoad() {
var userID = g_user.userID;
if (g_form.getValue('caller_id') == '')
g_form.setValue('caller_id', userID);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-31-2023 11:42 PM
Hi @k chaitanya kum ,
Create a Client Script, select type onLoad(), and Write a Script,
first, get the User Id then check if the Caller field is empty or not. if empty, set the UserId to the caller.
function onLoad(){
var user_Id = g_user.userID;
if(g_form.getValue('caller_id') == '' ){
g_form.setValue('caller_id',user_Id);
}
}