local procedure DeleteLines(var DocNo: code[20]; var DocType: Option; var ItemType: Option; FilterString: Text)
DeleteLines(rec."No.", rec."Document Type", [b]'ITEM'[/b], 'FLOC | FCOM | FRES | FLIFT');
SalesLine: Record "Sales Line";And then call your function like:
DeleteLines(rec."No.", rec."Document Type", SalesLine.Type::Item, 'FLOC | FCOM | FRES | FLIFT');
DeleteLines(rec."No.", rec."Document Type", 2, 'FLOC | FCOM | FRES | FLIFT');
Answers
You can pass ItemType::ITEM
Thanks,
Alternatively, since you can refer to options also as indexes the strings represent, you can lookup the existing options of "Sales Line".Type, find that it's:
" ,G/L Account,Item,Resource,Fixed Asset,Charge (Item)"
meaning that "Item" is index 2. With that, you can also call your function like:
It was the parameter declaration on my DeleteLines Proc.
I mistakenly had:
removing var in from front of the ItemType param fixed it.
I guess I'm not clear on how when to use var on a proc definition. I looked at the AL programming guide: https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-al-methods#CallMethod and it uses var in one parameter, but there's no explanation of it.
So when would I used "var: in the proc parameter and what does it do?
Also, how do I pass by Ref vs pas by Value?
TIA
Mark
RIS Plus, LLC