- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 09:07 AM
What I want to do is to populate the manager/supervisor, location, phone number, and e-mail fields once a user is chosen.
I have been trying to grab fields, but I am coming up with an error when I am trying to figure out the manager field.
TypeError: Cannot read properties of undefined (reading 'hiring_manager_supervisor_name')
function onLoad() {
var user = g_form.getReference('name');
jslog("********This message is from jslog().********");
jslog("Manager value = " + g_form.getValue('hiring_manager_supervisor_name', user.hiring_manager_supervisor_name));
jslog("This is the user." + g_user.getFullName());
jslog("********This message is from jslog().********");
}
I am using the onLoad function to see if I am able to grab values via debugging. I do know it should be an onChange function, but when I was trying to debug with JSlog, it would not populate the console. Is there a better way to test?
Any ideas on how I can get the values of the user's information? I feel as though I am calling on the wrong variable at the moment.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 09:19 AM
Hi Matthew,
You can use this Article for your requirement by Mark:
Catalog Data Lookup Definition on any table, eliminating Catalog Client Scripting
Mark my answer correct & Helpful, if Applicable.
Thanks,
Sandeep

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2022 09:22 AM
Hi,
1) You can use g_form.addInfoMessage() also for debugging
2) You are using getValue instead of setValue
3) OnLoad if the name field is empty then you cannot set it based on that field. You definitely need onChange.
Regards,
Sumanth