- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 04:00 AM
Hi All
I seem to have an issue with this client script not executing correctly on a Catalog Item. The script is looking up a user on the sys_user table using a callback function. Then depending on if the field on the looked up user record has a value in it, will then make a variable on the catalog item hidden or visible. As it currently stands the form is hidding variables even when there is no entry on the looked up field, whereas it shoudl be displaying the variabIe.
Ithink i am missing something between each of the "if" statements. Can anyone assist?
//AM I MISSING SOMETHING TO SEPERATE THE ABOVE FROM THE BELOW "IF" STATEMENT
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-10-2025 04:18 AM
Hi, I have found the issue. It was due to an ACL on the sys_user table, which prevented the results of the client script from being displayed. Thankyou for you assistance anyway, it was very kind of you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 04:23 AM
Hi,
Can you simplify the scenario?
shorted the script and explain what you expect if variable u_dunsaperppreprodusername has value ?
In your example you have the below piece of code repeated, why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 04:46 AM
Hi Anurag
So on my scrip on line 7, I have the callback which is looking up the user record on the sys_user table.
If the field "u_dunsaperpprodusername" on the that users record has a value in it then the variable "sap_ecc_production" on the form should be hidden.
If the field "u_dunsaperpprodusername" on the that users record doesnt have a value in it then the variable "sap_ecc_production" on the form should be visable.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 05:27 AM
So that becomes this
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
var usr = g_form.getReference('name_of_existing_colleague',callBack);
}
function callBack(usr){
if (usr.u_dunsaperpprodusername != "") {
g_form.setDisplay('sap_ecc_production',false);
} else
{
g_form.setDisplay('sap_ecc_production',true);
}
}
Test this and reply if this works. Just for this field.
then we will take the other fields on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-09-2025 05:49 AM
Hi Anurag,
Your script doesnt work, I can get it to work when it is only doing one field usign this script:-