Checking a field value is number or not

conatctId = voucherRecord.getFieldValue("custrecord_treating_dentist");
var isnum = /^\d+$/.test(conatctId);
nlapiLogExecution("DEBUG", 'isnum', isnum);
if (isnum) {
  contactname = nlapiLookupField("contact", conatctId, "entityid");
} else {
  contactname = conatctId;
}

Leave a comment

Your email address will not be published. Required fields are marked *