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

Notifications

Announcements

Community site session details

Community site session details

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

page field from other table

(0) ShareShare
ReportReport
Posted on by 95

Hello everyone,

I am creating a page obtaining the data from the table SourceTable = "Sales Shipment Line", which among other fields contains the customer number, customer name, shipment number, ...

What you would need is to be able to indicate in the customer name field the name of the customer that appears in the shipment header. But I do not want to create any field (extended table) in the shipment header table. i want to directly assign the name of the client on the page.

The relation field is the shipment number, but i dont know how define the field customer name.

Regards,

I have the same question (0)
  • Community Member Profile Picture
    on at

    You can create a Text Variable in the page and populate this variable with the value from "Sell-to Customer Name" field  in Sales Shipment Header.

  • Teddy Herryanto (That NAV Guy) Profile Picture
    14,296 Super User 2026 Season 1 on at

    Create a new text variable. On the trigger OnAfterGetRecord, you can put a logic to retrieve the customer name from sales shipment header and assign it to the new text variable. You can then show that variable in the page.

  • Business Central Profile Picture
    95 on at

    Hello,

    I am noob in AL programing.

    I created a global var named CustomerName: text;

    And dont know how to do the trigger OnAfterGetRecord() to assign to the variable the value of the customer name, relating the table sales header with that Sales Shipment Lines by the document number.

    I do this but dont show any value.

    trigger OnAfterGetRecord()
        var
            TSalesHeader: Record "Sales Shipment Header";
            //TSalesLines: Record "Sales Shipment Line";
        begin

            TSalesHeader.SetRange("No.", Rec."Document No.");
            CustomerName := TSalesHeader."Bill-to Name";
            
        end;
    Regards,
  • jor1hp Profile Picture
    80 on at

    you try using querys?

  • Business Central Profile Picture
    95 on at

    Querys??Why??

    i did this:

    trigger OnAfterGetRecord()

       var

           TSalesHeader: Record "Sales Shipment Header";

       //TSalesLines: Record "Sales Shipment Line";

       begin

           TSalesHeader.Reset();

           TSalesHeader.SetFilter("No.", Rec."Document No.");

           Message(TSalesHeader."Bill-to Name" + 'hola');

    But Message show blank.

    i did too without any filter and show blank

    Rec is Sales Shipment Line table.

    Regards,

  • Verified answer
    Community Member Profile Picture
    on at

    use below code

    TSalesHeader.get("Document No.");

    Message(TSalesHeader."Bill-to Name" + 'hola');

  • Business Central Profile Picture
    95 on at

    Hello,

    that work good.

    The end code i used is:

    Field:

    field("Customer Name"; CustomerName)

                   {

                       Caption = 'Customer Name', Comment = '"ESP="Nombre Cliente"';

                       ApplicationArea = Basic, Suite;

                       ToolTip = 'Specifies the name of customer.', Comment = '"Especifica el nombre del cliente."';

                   }

    ...

    var

           CustomerName: text;

       trigger OnAfterGetRecord()

       var

           TSalesHeader: Record "Sales Shipment Header";

       begin

           TSalesHeader.Reset();

           TSalesHeader.Get("Document No.");

           CustomerName := TSalesHeader."Bill-to Name";

       end;

    Regards,

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…

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 2,068 Super User 2026 Season 1

#2
Dhiren Nagar Profile Picture

Dhiren Nagar 1,194 Super User 2026 Season 1

#3
YUN ZHU Profile Picture

YUN ZHU 1,123 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans