FILTERGROUP filtering fails after SETSELECTIONFILTER

ReboghRebogh Member Posts: 13
Story of one bug. NAV 2015 W1.
I want to get some lines from filtered page. So, I`ve created global function on a page with SETSELECTIONFILTER and some piece of code:
PurchaseLine.FILTERGROUP(20);
PurchaseLine.SETRANGE("Document Type",PurchaseLine."Document Type"::Order);
PurchaseLine.SETRANGE("Document No.",PurchaseDocumentHeader."Order No.");
PurchaseLine.FILTERGROUP(0);

PurchaseLines.LOOKUPMODE(TRUE);
PurchaseLines.SETTABLEVIEW(PurchaseLine);
IF PurchaseLines.RUNMODAL = ACTION::LookupOK THEN BEGIN

  PurchaseLines.GetSelectedLines(PurchaseLine);

  //need to duplicate prev. filters in case of copy all lines with filtergroup error
  PurchaseLine.SETRANGE("Document Type",PurchaseLine."Document Type"::Order);
  PurchaseLine.SETRANGE("Document No.",PurchaseDocumentHeader."Order No.");
View on page is filtered correctly. When you select some lines and click OK -
you`ll get what you expect. But if you want to select all the lines in view (either pressing ctrl+c or nice button in top-left page corner),
you`ll get all the lines, ignoring filtergroup! Some solution you can see below comments, but it`s not the way it should be)

If someone can advise how can this bug be sent to Microsoft - it would be nice. Cause I didn`t find a quick way to do this...

Comments

  • vaprogvaprog Member Posts: 1,140
    Hi,

    I don't know where to report bugs either, but I can confirm that SETSELECTIONFILTER does not work as it used to, nor as it is documented online.

    It copies only filters of some assorted filtergroups. Try filtergroup 3 for instance. That works.

    Btw. I did not find a function PurchaseLine.GetSelectedLines. Is it a customization?
  • ReboghRebogh Member Posts: 13
    Thank`s for reply, I`ll try to use third group.
    Yep, that is custom function to retrieve SETSELECTIONFILTER result.
Sign In or Register to comment.