Restricting logged in user in a record producer

charan_1
Tera Contributor

Hi i was having a requirement to create a variable where type is reference and the variable dropbox contain the user list. The condition is for logged in user not able to select their name from the dropdown can anyone help me with these.

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Charan,

An onChange() client script that works on selection of the value in the reference field as below should help.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    if (g_form.getValue(' your variable name here') == g_user.userID)
        alert("Employees do not need to submit this request for themselves.");
    g_form.setValue('your variable name here', '');


    //Type appropriate comment here, and begin script below

}

View solution in original post

1 REPLY 1

Jaspal Singh
Mega Patron
Mega Patron

Hi Charan,

An onChange() client script that works on selection of the value in the reference field as below should help.

function onChange(control, oldValue, newValue, isLoading, isTemplate) {
    if (isLoading || newValue === '') {
        return;
    }
    if (g_form.getValue(' your variable name here') == g_user.userID)
        alert("Employees do not need to submit this request for themselves.");
    g_form.setValue('your variable name here', '');


    //Type appropriate comment here, and begin script below

}