onSubmit catalog client script not submitting in Service Portal

KB30
Tera Expert

Hello,

 

I'm having issues with my onSubmit catalog client scripts. I creates 2 scripts that will check if urgency or impact is selected, it will stop the submit. After changing and trying to submit, it does nothing when i try to submit. Here is one of the script below. They are the same except for the variable name. Please assist if you can.

 

 

function onSubmit() {

g_form.getValue('please_indicate_the_urgency_of_this_outage');
if (g_form.getValue('please_indicate_the_urgency_of_this_outage') == '3');
g_form.addErrorMessage("Please submit the Create Incident form if urgency is Lower Priority");
return false;

1 ACCEPTED SOLUTION

Amit Pandey
Kilo Sage

Hi @KB30 

Can you set UI Type to all and try the following script-

function onSubmit() {
    if (g_form.getValue('please_indicate_the_urgency_of_this_outage') == '3') {
        g_form.addErrorMessage("Please submit the Create Incident form if urgency is Lower Priority");
        return false;
    }
    return true;
}

It should do.

 

Regards,

Amit

View solution in original post

11 REPLIES 11

Amit Pandey
Kilo Sage

Hi @KB30 

Can you set UI Type to all and try the following script-

function onSubmit() {
    if (g_form.getValue('please_indicate_the_urgency_of_this_outage') == '3') {
        g_form.addErrorMessage("Please submit the Create Incident form if urgency is Lower Priority");
        return false;
    }
    return true;
}

It should do.

 

Regards,

Amit

Thank you @Amit Pandey