Discussions
Problems with nlapiSearchDuplicate on customer form
Hi,
I have a problem: In my custom customer form, i've custom field. This field is a mandatory field: custentity4.
I want to validate this field from suitescript, but when i execute this script on my custom customer form, i've this error:
"An unexpected error occurred in a script running on this page.
validaCamposBody (validateField)
customform
SSS_INVALID_SRCH_FILTER
An nlobjSearchFilter contains invalid search criteria: 3."
My SuiteScript is:
function validaCamposBody(type, name)
{
//Valida duplicidad de clientes por campo RUC
if (name == 'custentity4')
{
var arraySearch = new Array();
arraySearch[0] = nlapiGetFieldValue('custentity4');
var duplicateRUC = nlapiSearchDuplicate('customer',arraySearch);
if (duplicateRUC.lenght >= 1)