Hello,
I am receiving unwanted results when filtering on the 'Gen. Journal Batch' table (232) in Nav 2013
The code will produce a list of all of the journal batches being used by the user but I can't figure out how to filter it correctly.
Currently I have the code below which should return 2 rows, 1 row for 'DEFAULT' and 'GENERAL' and another for 'CINDY' and 'CASH RECEI'.
But unfortunately it is returning 3 because 'CASH RECEI' also has a journal with the name 'DEFAULT'.
I understand why the results are returning the way they are but I am stumped on how to fix it without renaming journals.
//Current code to filter
GenJnlBatch.SETFILTER(Name,'DEFAULT|CINDY');
GenJnlBatch.SETFILTER("Journal Template Name",'GENERAL|CASH RECEI');
GenJnlBatch.FILTERGROUP(0);
Thank you for the help,
Jake
0
Comments
Franz Kalchmair, MVP
Alias: Jonathan Archer
please like / agree / verify my answer, if it was helpful for you. thx.
Blog: http://moxie4nav.wordpress.com/
Oh I understand now - thought you was querying a bug in the Setfilters.
Marking required records is a good tool too for picking and choosing select records also, i.e., for selecting Customer Sales
CustSales.SETFILTER(Open,'Yes');
CustSales.SETRANGE("Document Type","Document Type"::Invoice);
IF CustSales.FIND('-') THEN REPEAT
IF CustRec.GET(CustSales."Customer No.") THEN
CustRec.MARK(True);
UNTIL CustSales.NEXT=0;
To find marked records:
CustRec.MARKEDONLY(True);
IF CustRec.FIND('-') THEN REPEAT
CustRec.MARK(False);
UNTIL CustRec.NEXT=0;
Hope helps