Skip to main content

Notifications

Community site session details

Community site session details

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

How to get value from a filed in a page to another page?

(0) ShareShare
ReportReport
Posted on by 15

I have created a 2 new custom fields in customer table you can see the below screenshot

pastedimage1619088174336v2.png

I have also created the same fields in the sales header, now when I create a sales order with the above customer, I want to flow the data of those 2 fields to the sales order. Can you guys please help me with this?

pastedimage1619088179665v3.png

  • Lars Lohndorf-Larsen Profile Picture
    on at
    RE: How to get value from a filed in a page to another page?

    Hello,

    You don't mention which version, but as you say that you are adding fields to an existing table, I take that this is BC14 or earler, OnPrem. If you need this for SaaS, then we need to work with extensions, and then the answer would be a bit different, but the same principle really.

    NAV / Business Central is trigger driven. Wherever possible, use Table Triggers and then your business logic will apply no matter from where you call it (from any page, from code, from Web Services, etc). So what you want here, is on table 36 "Sales Header" - trigger "Sell-to Customer No. - OnValidate()". Look for this line:

    GetCust("Sell-to Customer No.");

    After this you can assign from the Cust variable to your Sales order record, like this:

    "Customer Text" := Cust."Customer Text";

    "Customer Option" := Cust."Customer Option";

    I think this should do. It does require a develoeprs license to access triggers. If you don't have that, there is also the option to add the fields as FlowFields, so they are calculated fields on the Sales Order, that look up the values in the Customer Table, like this:

    Field properties:

    FieldClass = Flowfield

    CalcFormula = Lookup(Customer."Customer Text" WHERE (No.=FIELD(Sell-to Customer No.)))

    pastedimage1619093667106v1.png

    I hope this helps.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

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

#1
Sohail Ahmed Profile Picture

Sohail Ahmed 932

#2
YUN ZHU Profile Picture

YUN ZHU 841 Super User 2025 Season 1

#3
Mansi Soni Profile Picture

Mansi Soni 602

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans