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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

creating global variable for Name + Surname

(0) ShareShare
ReportReport
Posted on by

I am a Junior Developer that has never worked with this language before. I have received so tasks for training and I am having a hard time figuring it out. Can any one help?

Tasks: 1 - On Loan Card page create a field (variable) that will show Name + Surname. Not a table field but a page field

a - create global variable on Loan Card page with a type Text and name it FullName

b - add this variable as a field on a page

c - Write code that will update this variable when First Name or Last Name is modified (you can do that by utilizing OnValidate trigger)

I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    99,502 Super User 2026 Season 1 on at

    Hi, Below is an example in BC. (AL Language)

    And because the standard does not have a Loan Card page, so I use Employee Card as an example.

    a:

    pastedimage1646351203018v1.png

    b:

    pastedimage1646351283299v2.png

    c:

    pastedimage1646351454811v4.png

    On the page:

    pastedimage1646351439702v3.png

    Source code:

    pageextension 50113 EmployeeCard extends "Employee Card"
    {
        layout
        {
            addafter("Last Name")
            {
                field(ZYFullName; ZYFullName)
                {
                    Caption = 'Full Name';
                    ApplicationArea = All;
                    Editable = false;
                }
            }
    
            modify("First Name")
            {
                trigger OnAfterValidate()
                begin
                    ZYFullName := Rec."First Name"   ' '   Rec."Last Name";
                end;
            }
    
            modify("Last Name")
            {
                trigger OnAfterValidate()
                begin
                    ZYFullName := Rec."First Name"   ' '   Rec."Last Name";
                end;
            }
        }
    
        var
            ZYFullName: Text;
    }

    Hope this will help.

    Thanks.

    ZHU

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

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

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 1,933 Super User 2026 Season 1

#2
YUN ZHU Profile Picture

YUN ZHU 1,055 Super User 2026 Season 1

#3
Teagen Boll Profile Picture

Teagen Boll 640 Super User 2026 Season 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans