How to autopopulate caller field with the current login user details using client script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 08:22 AM
How to autopopulate caller field with the current login user details using client script ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2022 08:26 AM
Hi Sharath,
No need to write client script to auto populate caller with current logged in user.
Open that field in dictionary level and in default value write the below line
javascript: gs.getUserID()
If you still want to go with client script then write below:
function onLoad() {
var userID = g_user.userID;
if (g_form.getValue('caller_id') == '') //check caller id field name
g_form.setValue('caller_id', userID);
}
Mark as correct and helpful if it solved your query.
Regards,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-12-2022 08:02 AM
Feel free to post if your have further queries or you can mark an answer as correct and helpful to close the thread.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2023 07:20 AM
How can I make this work for the now mobile app? I inserted this into the dictionary field on the incident level and it works in the console. But it does not work for creating an incident in the now mobile app.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-27-2023 01:56 AM
but it should happen only for new records