- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 02:28 PM
Hello,
Please help with populating assigned to field with login user name when form is loading.
I have tried the following script, but was not successful. Please help. Thank you
function onLoad() {
//Type appropriate comment here, and begin script below
var loginName = g_user.firstName+' '+g_user.lastName;
g_form.setValue('Assigned_to', loginName);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 02:50 PM
If you're referring to the Assigned to field on the task table (or incident, problem, change, requested item, ...) the field name is assigned_to, and it requires a sys_id for its value, so your script would look more like this:
function onLoad() {
g_form.setValue('assigned_to', g_user.userID);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 02:50 PM
If you're referring to the Assigned to field on the task table (or incident, problem, change, requested item, ...) the field name is assigned_to, and it requires a sys_id for its value, so your script would look more like this:
function onLoad() {
g_form.setValue('assigned_to', g_user.userID);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-07-2024 07:57 PM
Hi @Brad Bowman
Thank you for your assistance! I gained a lot of knowledge from the community.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-08-2024 02:33 AM
You are welcome! Happy to help!