Tuesday, July 9, 2019

Alternate Solution for 'validateField' event not working for drop-down select or check box fields

As documented in the Client Event Types, the event type does NOT apply to drop-down select or check box fields. As an alternate solution, we can use the fieldChanged event type.

Code Samples


function validateFieldChange(type,name,linenum){
if((type =='line') && (name =='department')){ 
    if(nlapiGetCurrentLineItemValue(type, name) == '2'){
   alert('Please select a different value');
   nlapiSetCurrentLineItemValue(type, name, '', true, true);
  }
}
}

No comments:

Post a Comment