copied a variable set, and added a new tittle. notworking

asd22
Tera Contributor

Hello.

 

I have a variable set with name(refrence field to user), ID (singel line text).

and a catalog script that gets the ID of the selected. I copied this since i was asked to. And just added a new tittle and now the catalog script is not working, what may the issue be? I have tried everything i can.

function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    var userref = g_form.getReference('name', userLookup);
    function userLookup(userref) {
        g_form.setValue('id', userref.user_name);
    }
}
1 ACCEPTED SOLUTION

Not the script type. You need to select another variable name onChange of which this client script is running   and then revert that back . Reason being system stores sys_id of the variable and its still storing the sys_id of the variable that is part of the old variable set.

Gurpreet07_0-1699610193269.png

 

 

View solution in original post

6 REPLIES 6

Gurpreet07
Mega Sage

Try to switch the onChange field to other field and then save .  then reselect the previous field and check if its working.

asd22
Tera Contributor

changed it to onload saved, then to onchange again. Did not work

Not the script type. You need to select another variable name onChange of which this client script is running   and then revert that back . Reason being system stores sys_id of the variable and its still storing the sys_id of the variable that is part of the old variable set.

Gurpreet07_0-1699610193269.png

 

 

asd22
Tera Contributor

i see mye new catalog script hs not gotten a variable name

asd22_0-1699611143318.png


may this be the issue,