Skip to content


question about doctype field in payables batch

deanne asked 2 years ago
if (_Account=”10-01-2006″ and _DEBIT<>0.00) then return “5” else 
if( _Account=”10-01-2001″ and _DEBIT<>0.00) then return “5”  else return “1”
Using the formula above – trying to get the doctype to show credit memo instead of invoice.  Nothing seems to work – any suggestions?
Lorren Zemke Staff answered 2 years ago
I assume that since you are creating a Payables Transaction, you have grouped for the Header section to get one document and multiple distribution lines. To me it seems as though you wouldn’t have the ability to look at 1 account and/or amount.
Either way, when writing the vb logic you need to make sure to use line separators and when comparing strings, be sure to remove extras spaces that may exist.
if _Account.Trim() = “10-01-2001” and _DEBIT <> 0.00 then
return 5
return 1
end if

If you would like to submit an answer or comment, please sign in to the eOne portal.