Paul_s
02/25/2020, 11:01 AMvar result = nlapiSearchRecord('customrecord_gc_otif_if_variances', null, filters, columns);
search works fine, however I'm having difficulties when there are no records found.
Result outputs as an empty string if you log it, typeof shows it as an object, trying to do result.length tells me it is null, but checking if result === null returns false.
any ideas?battk
02/25/2020, 11:09 AMbattk
02/25/2020, 11:10 AMPaul_s
02/25/2020, 11:12 AMbattk
02/25/2020, 11:14 AMnlapiLogExecution('DEBUG', '=== null', result === null)
battk
02/25/2020, 11:14 AMPaul_s
02/25/2020, 11:14 AMbattk
02/25/2020, 11:16 AMbattk
02/25/2020, 11:18 AMif (!result || !result.length) {
return;
}
battk
02/25/2020, 11:19 AMvar result =
nlapiSearchRecord(
"customrecord_gc_otif_if_variances",
null,
filters,
columns
) || [];
to force the search results to be an array for consistencyPaul_s
02/25/2020, 11:19 AMPaul_s
02/25/2020, 11:20 AM