- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2024 02:09 PM
Hello developers,
Quick question,
I have a record producer that's built off of the vendor contact table to allow vendors to submit requests. I have a UI policy script to auto-populate the vendor contact's name into the requested by field. This part is partially working.
So its pulling the sys_id of the vendor contact instead of their actual name in requested by field.
Could someone check my this script to see if its correct?
function onCondition() {
g_form.setValue('requested_by',g_user.userID);
g_form.setReadOnly('requested_by',true);
g_form.setMandatory('requested_by',false);
}
Any guidance will be greatly appreciated!
Best regards,
Corey
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-03-2024 02:04 PM
Hi @Brad Bowman
Finally got the issue resolved and it was just a role issue. We needed to add the 'vendor_contact' role to the user's profile and that fixed the issue.
Thanks for your help on this issue.
Best regards,
Corey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2024 02:15 PM
Typically you want the sys_id to populate into a reference field on the sys_user table. This prevents typos, same name confusion, etc. The reference field will display the Name of the user, not the sys_id. Is requested_by not a reference variable? Is it mapped to a field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2024 02:27 PM
Hi @Brad Bowman
Thanks for responding!
Yes, the requested_by field is a reference variable. It's not mapped to a field, we just want the vendor contact to know they are the correct person that is submitting the request (per business requirements).
Best regards,
Corey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-25-2024 02:32 PM
I guess I am not following then - are you seeing a sys_id when the UI Policy script populates the variable? Do you see the same when you manually select a record in requested_for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2024 03:39 PM
Hi @Brad Bowman
Apologies on the late response. I got sidetracked working on a different issue. But yes, when the ui policy populates the variable, its showing the sys_id in that field. However, its a reference field so when I manually select a record, it shows the actual name of the requestor.
Best regards,
Corey