Marwan
05/24/2021, 3:38 AMfunction lookUpCreditMemo(invoiceID) {
var creditmemoID = "";
try {
var srch = search.create({
type: "creditmemo",
filters: [
["createdfrom", "is", invoiceID],
"AND",
["amountremaining", "greaterthan", 0],
"AND",
["applied", "is", 0],
"AND",
["custbody_edc_trans_type", "anyof", [2, 4]],
],
columns: ["tranid"],
});
var searchResultCount = srch.runPaged().count;
log.audit("search count", searchResultCount);
if (searchResultCount > 0) {
creditmemoID = srch.run().getRange(0, 1)[0].id;
}
} catch (e) {
log.error({ title: "LookUp Credit Memo: " + invoiceID, details: e });
}
return creditmemoID;
}
I have this search, which runs fine if I removed the filter on the applied
field, but with it, it gives this error:
An nlobjSearchFilter contains invalid search criteria: applied.
I can't figure out what is wrong with itbattk
05/24/2021, 4:34 AMapplied
is a filter?Marwan
05/25/2021, 10:51 AMbattk
05/25/2021, 11:05 AMMarwan
05/25/2021, 11:06 AMMarwan
05/25/2021, 11:06 AMcustbody_edc_trans_type
there and it is workingMarwan
05/25/2021, 11:06 AMbattk
05/25/2021, 11:08 AMMarwan
05/25/2021, 11:37 AM