Create a userrharper@messtone.com,NetSuite time object function ID004_Uncheck_Supervisor_Approval_Flag(type 1099 vendor){nlapiLogExecution(‘DEBUG’,’type is ‘+type);var recordID=nlapiGetRecordId( );nlapiLogExecution(‘DEBUG’,’recordID is ‘+recordID);if(recordID){if(type==’create’){var rec=nlapiLoadRecord(‘timebill’,recordID);var vendorid=rec.getFieldValue(’employee’);nlapiLogExecution(‘DEBUG’,’Create Supervisorflag start is ‘+rec.getFieldValue(‘supervisorapproval’));nlapiLogExecution(‘DEBUG’,’Looking Up Employee/Vendor ID:’+vendor I’d);try{vendor id=nlapiLoadRecord(‘vendor’,vendor I’d);if(vendor id){nlapiLogExecution(‘DEBUC’,’Vendor ‘+vendor id+”found.”);//if vendor ID is found,then go ahead with time record modification rec.setFieldValue(‘supervisorapproval’,’F’);var id=nlapiSubmitRecord(rec,true);}else{ } nlapiLogExecution(‘DEBUG’,’Employee ‘+vendor I’d +”found.Nothing to do.”);}}catch(e){//do nothing.This is not a vendor.nlapiLogExecution(‘DEBUG’,’Vendor not found.This is an employee.Nothing to do.’);} nlapiLogExecution(‘DEBUG’,’Create Supervisorflag End ‘+rec.getFieldValue(‘supervisorapproval’));}if(type==’edit’){var rec=nlapiLoadRecord(‘timebill’,recordID);var vendor id=rec.getFieldValue(’employee’);var status=rec.getFieldValue(‘status’)nlapiLogExecution(‘DEBUG’,’Edit Status is ‘+status);nlapiLogExecution(‘DEBUG’,’Edit Supervisorflag Start is ‘+rec.getFieldValue(‘supervisorapproval’));nlapiLogExecution(‘DEBUG’,’Looking Up Employee/Vendor ID :’+vendor id);try{vendor id=nlapiLoadRecord(‘vendor’,vendor id);if(vendor id){nlapiLogExecution(‘DEBUG’,’Vendor ‘+vendor id+”found.”);//if vendor ID is found,then go ahead with time record modification rec.setFieldValue(‘supervisorapproval’,’F’);var id=nlapiSubmitRecord(rec,true);}else{ }nlapiLogExecution(‘DEBUG’,’Employee ‘+vendor id+”found.Notthing to do.”)}}catch(e){//do nothing.This is not a vendor.nlapiLogExecution(‘DEBUG’,’Vendor not found.This is an employee.Nothing to do.”)}nlapiLogExecution(‘DEBUG’,’Edit Supervisorflag End is ‘+rec.getFieldValue(‘supervisorapproval’));}}} userrharper@messtone.com,NetSuite time object “ID004_Uncheck_Supervisor_ApprovalFlag”. Messtone 1099 vendor.

Leave a comment