web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

AL: Get Selected Rows from List of Temp Table

(0) ShareShare
ReportReport
Posted on by 80

Hi there,

I've got a temp table called "TempShoppingList" that's being shown to the user in a new List page. I want to be able to perform an action on items that have been selected in that list. My current action looks like:

action(RaisePO)
            {
                Caption = 'Raise PO';
                Image = "Import";
                Promoted = true;
                PromotedCategory = Process;
                ApplicationArea = All;

                trigger OnAction();
                var
                    Line: Record "TempShoppingList"; // this is the page source table
                begin
                    CurrPage.SetSelectionFilter(Line);

                    if Line.FindSet() then
                        // codeunit.DoThing(Line)
                    else
                        Message('None selected');
                    exit;
                end;
            }

However, regardless of what is selected in the UI - the message stating 'None selected' always shows. I've managed to get the above working for normal out of the box tables, but not with tempoary tables. Is there anything I'm missing? Thanks in advance

I have the same question (0)
  • Verified answer
    Teddy Herryanto (That NAV Guy) Profile Picture
    14,284 Super User 2025 Season 2 on at

    Because the temporary table on the page (rec) and the temporary table on the action (Line) are two different variables.

    Try using copy first.

    Line.Copy(Rec,true);

    CurrPage.SetSelectionFilter(Line);

    if Line.FindSet() then

  • sjsbls Profile Picture
    80 on at

    Ah, that makes sense. Copying works great, thanks!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,135

#2
YUN ZHU Profile Picture

YUN ZHU 733 Super User 2025 Season 2

#3
Sumit Singh Profile Picture

Sumit Singh 612

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans