IF MyPackingListLine.FINDSET THEN BEGIN MyPackingList.SETFILTER("Packing List No.",MyPackingListLine."Packing List No."); END;
CLEAR(MyPackingListLookupForm); MyPackingListLine.SETRANGE("Item No.","Item No."); IF MyPackingListLine.FINDSET THEN REPEAT MyPackingList.GET(MyPackingListLine."Packing List No."); //Or Setrange filtering depending on your key MyPackingList.MARK(TRUE); UNTIL MyPackingListLine.NEXT = 0; MyPackingList.MARKEDONLY(TRUE); IF NOT MyPackingList.ISEMPTY THEN BEGIN MyPackingListLookupForm.SETTABLEVIEW(MyPackingList); MyPackingListLookupForm.RUNMODAL; END;
Answers
Let us know what you tried.
Just a Tip - While Calling Lookup of the Table / Form, Pass A Record of Table with Filter of Item No.
Just wanted to make you think, if still any confusion let us know the code that you are trying.
Thanks & Regards,
Saurav Dhyani
Do you Know this About NAV?
Connect - Twitter | Facebook | Google + | YouTube
Follow - Blog | Facebook Page | Google + Page
CLEAR(MyPackingListLookupForm);
MyPackingListLine.SETFILTER("Item No.","Item No.");
IF MyPackingListLine.FINDSET THEN BEGIN
MyPackingList.SETFILTER("Packing List No.",MyPackingListLine."Packing List No.");
END;
IF MyPackingList.FINDSET THEN BEGIN
MyPackingListLookupForm.SETTABLEVIEW(MyPackingList);
MyPackingListLookupForm.RUNMODAL;
END;
WHERE
MyPackingListLookupForm is a variable of type Form Subtype Packing List - List
MyPackingList is a variable of type Record Subtype Packing List Header
MyPackingListLine is a variable of type Record Subtype Packing List Line
Item No is a field of the form
Now I'm able to retrieve the list of all PackingListLines with the Item. No. selected,
PackingListLines contains several Records I need to set the second FINDSET on MyPackingList with all the Packing List No. values retrieved in the step before.
Unfortunately only the last valus seems to be maintained by SetFilter.
Could you suggest me a way to perform this action ?
Thank you again for your precious help.
Best regards
Fabrizio
1st run: Filter = Item1
2nd run: Filter = Item2
This way when your loop is done the filter is set on the last item.
What you may want to try:
Marking is used for kinda advanced filters that arent easily done with simply setfilter or setrange. Of course you could still build a filterstring (item1|item2|item3.....) but that's not how i would approach it.
More info: https://msdn.microsoft.com/en-us/library/dd355288(v=nav.90).aspx
Thanks a lot for your help
Fabrizio
Regards, Wisa
IF NOT MyPackingList.ISEMPTY THEN BEGIN
MyPackingListLookupForm.SETTABLEVIEW(MyPackingList);
MyPackingList.CLEARMARKS;
MyPackingListLookupForm.RUNMODAL;
END;
Thank you again for your help.
Fabrizio