get reference

tghadage124
Tera Contributor

Hi guys , 

 

here I am trying to display a message " please look into it urgently as its issue related to VIP user when caller is VIP "  and priority is one on submit but its not going inside the loop to check can you please help you figure out if I am checking it correctly.

 

function onSubmit() {
    //Type appropriate comment here, and begin script below

    var user = g_form.getReference('caller_id',getcaller);
    var pri = g_form.getValue('priority');

    function getcaller(user) {

        if (user == 'vip' && pri == 1) {

            g_form.addErrorMessage('please look into it urgently as its issue related to VIP user');

        } else {
            g_form.addInfoMessage('everything looks good as of now');
        }

    }

}
7 REPLIES 7

Hi @Amit Verma , 

Have tried it worked.

 

thanks

@tghadage124 

 

Glad to know it worked for you! Can you please accept the solution as the right answer and mark it helpful for others in the community to follow.


Please mark this response as correct and helpful if it assisted you with your question.

Community Alums
Not applicable

I'd recommend converting the get reference scripts to a script include. In my opinion it's better practice and you can reuse it when you're checking for VIP elsewhere