Error on portal level during the catalog submission

LaraReddy
Tera Guru

Hello All and @Ankur Bawiskar ,

Can anyone please help us on the below issue.

We opened one catalog item on portal level and "Requested for" variable is auto populated,

And when we clear the "Requested for" variable to select other users then the next minute, we're getting the below error on Top.

Error:  undefined- does not have an employee number in the system. Please enter one manually.


Note: We're currently in Utah version and "Requested for" variable is in one variable set and all the used catalog items level we're getting the same error.


Thanks,
LARA

 
1 ACCEPTED SOLUTION

your client script is missing the code not to do the validation if value is empty, may be try putting below code after first line

 

if(newValue == ''){

return;

}

View solution in original post

6 REPLIES 6

Danish Bhairag2
Tera Sage
Tera Sage

Hi @LaraReddy ,

 

Can you check if there is any client script or UI policy for that field which is causing this error to appear on change please.

 

Mark my answer helpful & accepted if it helps you.

 

Thanks,

Danish

HI Danish,
Thanks for the response.

Yes, there is one on Change client script and It's runs on Requested for variable.

But not sure why the Error is coming after clearing the Requested for variable.

Script:

function onChange(control, oldValue, newValue, isLoading) {

var usrEmp = g_form.getReference('u_requestedFor', getEmpNum);

function getEmpNum(usrEmp) {
if (usrEmp.employee_number == undefined) { 
var a = g_form.getUniqueValue();
if (a != '6d914f3e1bdef300997ebb7acd4bcbb9') {
g_form.addErrorMessage(usrEmp.name + '- does not have an employee number in the system. Please enter one manually.');
}
g_form.setValue('catItemDef_employeeNumber', '');
} else {
g_form.setValue('catItemDef_employeeNumber', usrEmp.employee_number);
g_form.setReadOnly('catItemDef_employeeNumber', true);
}
}
}


Thanks.

your client script is missing the code not to do the validation if value is empty, may be try putting below code after first line

 

if(newValue == ''){

return;

}

Ankur Bawiskar
Tera Patron
Tera Patron

@LaraReddy 

any script is doing some validation on that variable?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader