New to Nav and AL code and working on first extensions. It's all working, but now I'm factorizing my code
I have a case statement that repeats this code and want to factorize it
SalesLine.SETRANGE("Document Type", rec."Document Type");
SalesLine.SETRANGE("Document No.", rec."No.");
SalesLine.SetFilter("No.", 'FJOB | FCOM | FRES | FLIFT');
I presume I could just pass Doc Type, Doc No, Line Type and the String for the Setfilter as params, so it's more general purpose (the calling proc can supply any list of items)
I've read about Setfilter, GetFilter and FilterGroups and wondering if I can somehow pass the entire "filter" as a single object instead of 4 params
What would be the best way to factorize this?