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...
Suggested Answer

How create New DataTable It contains (3 couloms)

(0) ShareShare
ReportReport
Posted on by 4

Hi ,,,,, How create New DataTable It contains (1 couloms) and

How do copy the contents of 1 fields (Rec./No./ ) value in the header (Sales Header) table to the New data table in

in AL Business Central 

===========================================================

pageextension 50100 /Sales Order Ext/ extends /Sales Order/
{
    actions
    {
        modify(Post)
        {
            Trigger OnAfterAction()
            var
  SalesHeaderRec: Record /Sales Header/;
                SalesLineRec: Record /Sales Line/;
            begin
Message('Hello from Posted! 1');
 
                CLEAR(SalesHeaderRec);
                CLEAR(SalesLineRec);
 
                SalesHeaderRec.SETFILTER(/No./, Rec./No./);
                SalesHeaderRec.FINDFIRST;
               
                Message('InvoiceID: %1', Rec./No./);
 
end;


 
        }
    }
 
}
 
 
 
 
 

 

 

I have the same question (0)
  • Ariba Mehdi Profile Picture
    166 on at
    Hi there,

    I am not sure if I understand this but let me assist you with my understanding of the problem.
    If you want to create a new table with 3 columns, follow the link below:
  • Suggested answer
    YUN ZHU Profile Picture
    95,544 Super User 2025 Season 2 on at
    Do you want to create a lookup feature? Select data in your new table?
    Hope the following helps.
     
    Thanks.
    ZHU
  • Community member Profile Picture
    2 on at
    Creating a new DataTable in AL Business Central with one column is done using the 'TableData' type. To copy the 'Rec./No./' field from the 'Sales Header' table  to the new DataTable, you can use a loop to fetch the values and populate the new table. Utilize functions like 'ADD' or 'MODIFY' for efficient data transfer. If you need specific code snippets or guidance,

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 3,151

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,443 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,092 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans