Based on the Opened for i want to use the onLoad script to auto populate the values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 06:22 PM
Hi,
Based on the Opened for i want to auto populate the Issue location, CCID, Simphony ID which are part of User table
here the condition would be i want to use only onLoad() client script, because i have used the auto populate option to populate but while i am impersonation or login as a user it is not working.
please advise how to create it by using the onLoad() client script
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 07:54 PM
Hi @kranthi2
You can use Auto-populate feature within the variable without scripting.
To autofill the Requestor (Opened for) when opening the form you can try this in the Default value of the variable.
javascript:gs.getUserID();
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 08:34 PM
Hi @Tai Vu
Yes you are correct i have used the same but it is not working if i login as a end user
but if i change the opened for it is working fine.
Please help me out the onLoad script for the same.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 10:49 PM
Hi @kranthi2
The default value should work, maybe you can debug by trying to put a specific sys_id there.
Regarding the onload client script, you can try below
function onLoad() {
g_form.setValue('opened_for', g_user.userID);
}
Cheers
Tai Vu