Discussions
Search Script working in Debugger but not when fired as a workflow action
All,
I have a script which works fine in debugger and as a workflow action when values are populated in the fields, I am currently trying to alter the script to allow for a multiseelct field to have no value. in debugger that field appears as null, but when I run it via the workflow action it has the value '[Ljava.lang.String;@208cfbfc', this is obviously then breaking the if condition which allows the filter to be skipped if null.
Why does the value between debugger and workflow action differ so much?
/** * Workflow Action Script * * @appliedtorecord * @returns {void} may have a return value */ function UTR_Find_email() { var newRec = nlapiGetNewRecord(); //For Testing Purposes //var newRec = nlapiLoadRecord('customrecord_user_event_record',2); var disabilities = newRec.getFieldValues('custrecord_usr_evt_disability'); var AccessTechnology = newRec.getFieldValues('custrecord_usr_evt_access_tech'); var Testertype = newRec.getFieldValue('custrecord_usr_evt_tester_type'); var DayAvailability = newRec.getFieldValue('custrecord_usr_evt_day_availability'); var TimeAvialbility = newRec.getFieldValue('custrecord_usr_evt_time_availability'); nlapiLogExecution('DEBUG', 'disabilities', disabilities ); var search = nlapiLoadSearch('customrecord_user_testers_record','customsearch_usr_tstr_rec_search'); //Define search Filters var i = 0; var filters = new Array(); if (disabilities != null) { filters[i] = new nlobjSearchFilter('custrecord_usr_tstr_disability', null, 'allof', disabilities); i++ } if (AccessTechnology != null) { filters[i] = new nlobjSearchFilter('custrecord_usr_tstr_access_tech', null, 'allof', AccessTechnology); i++ } if (Testertype != null) { filters[i] = new nlobjSearchFilter('custrecord_usr_tstr_tester_type', null,