AL icon indicating copy to clipboard operation
AL copied to clipboard

CurrPage.SetSelectionFilter not work after sort by Descending

Open monchangg opened this issue 7 years ago • 6 comments

CurrPage.SetSelectionFilter not work after sort by Descending

Steps and to reproduce the behavior:

  1. I created pageextension for Sales Order List and AL code as below:
pageextension 50102 extSalesOrderList extends "Sales Order List"
{
    actions
    {
        modify(Post)
        {
            trigger OnBeforeAction()
            begin
                nodCheckSelectedDocuments();
            end;
        }
    }

    var
        nodSelectedList: List of [Text];

    local procedure nodCheckSelectedDocuments()
    var
        markedCount: Integer;
        selectedCount: Integer;
        allCount: Integer;
        recCount: Integer;
        soList: Record "Sales Header";
    begin
        Clear(nodSelectedList);
        Clear(soList);
        soList.SetRange("Document Type", soList."Document Type"::Order);
        if soList.FindSet() then begin
            allCount := Rec.Count;
            CurrPage.SetSelectionFilter(soList);
            selectedCount := soList.Count;
            repeat
                if soList.Mark() then
                    nodSelectedList.Add(soList."No.");
            UNTIL soList.Next() = 0;
        end;
    end;
}
  1. Open Sales Order List page and make "SELL-TO CUSTOMER NO." column in descending order like following screenshot. image

And then select more than one records. After that click Post button and execute my procedure to get selected records but failure. It seems CurrPage.SetSelectionFilter doesn't work.

Could anyone please help me to look into this? Is AL's existing bug?

  • AL Language: 3.0.168874
  • Business Central: 14.0.29537.31808-US

monchangg avatar Sep 06 '19 07:09 monchangg

@monchangg have you tried this sample on the latest preview?

atoader avatar Sep 07 '19 11:09 atoader

@atoader No, is there no this issue with the latest preview release?

monchangg avatar Sep 09 '19 02:09 monchangg

@monchangg if this does not reproduce in the latest release, you will have to open a request for hotfix through the standard channel.

atoader avatar Sep 09 '19 18:09 atoader

@atoader I tested on latest preview release, it can reproduce this issue.

monchangg avatar Sep 16 '19 08:09 monchangg

Looks like a candidate for a Request for Hotfix.

kalberes avatar Nov 30 '21 10:11 kalberes

I just encountered pretty much the same problem. Has there been a fix made for this? @kalberes

hundredspoons avatar Aug 10 '26 14:08 hundredspoons