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

Pass EORI value from Customer card to Sales header

(0) ShareShare
ReportReport
Posted on by 98

Howto pass the field Eori number from the customer card to the sales header (order confirmations/ sales invoice)

eori.JPG

Extend the sales header table.

I have the same question (0)
  • BCgs Profile Picture
    470 on at

    I had the same issue as this is not available on the default report without modification.

    I duplicated it into fax number for the moment and outputted that to get around it

    I believe there are some new report extension capabilities due Q2 this year, so you should be able to do this then.

  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello,

    I am not familiar with this particular field, but most values are copied from Customer to Sales Header on the "Sell-to Customer No.".OnValidate trigger. If you have (developoment) access to this, then you can copy it across there. I have not tested this, but I think a line like this should be enough:

    "EORI Number" := Cust."EORI Number";

    But as mentioned you do need dev access for that.

  • Hans Werps Profile Picture
    98 on at

    Lars,

    We have a staging env. cloud).

    Where to add the line "EORI Number" := Cust."EORI Number";?

  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello, 

    You will need access to the development environment, then from "Sales Header" table, use the validation trigger for when the customer is entered. It cannot be done in configuration, it needs development acces and license.

  • Hans Werps Profile Picture
    98 on at

    Lars,

    Can this be done this way with cloud version Dynamics 365 BC and an extension?

  • Lars Lohndorf-Larsen Profile Picture
    on at

    Hello,

    Since it am not the one who would not be doing it, I cannot promise this yes or no. But I would show this to your partner and get their input to this. I hope you understand.

  • Suggested answer
    Guillem Padilla Profile Picture
    427 on at

    Hi Hans,

    You need to develop an Extension and publish it in your BC.

    This is an example of what you can do to transfer this field:

    Create a codeunit and add a subscriber event to the OnAfterValidateEvent of the "Sell-to Customer No." field.

    This code will be executed every time the "Sell-to Customer No." field is updated.

    [EventSubscriber(ObjectType::Table, Database::"Sales Header", 'OnAfterValidateEvent', 'Sell-to Customer No.', false, false)]
    local procedure ValidateEORIOnSalesHeaderOnAfterValidateEventSelltoCustomerNo(var Rec: Record "Sales Header")
    var
        Customer: Record Customer;
    begin
        Customer.Get(Rec."Sell-to Customer No.");
        Rec.Validate("EORI Number", Customer."EORI Number");
    end;

    
    

    Notice that I have not found an equivalent field for "EORI Number" in the "Sales Header" table, so maybe you need to create it by a tableextension.

  • Suggested answer
    JAngle Profile Picture
    133 on at

    An extension is needed but not on the sales header. Extending report objects isn’t ready in time so it will mean a new report. Suggestion from Lars is correct. The eori number from the company information is on the standard reports already. Fax No. as mentioned has been a popular way of getting it from the customer without developing

  • Hans Werps Profile Picture
    98 on at

    Guillem Padilla , Thanks.

    Code is working!

  • Hans Werps Profile Picture
    98 on at

    Guillem Padilla,

    Thx the code is working for sales header. Got same code working when new sales invoice is created.

    Is it possible also to do this for the sales invoice header when you post from sales order? 

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,606

#2
YUN ZHU Profile Picture

YUN ZHU 931 Super User 2025 Season 2

#3
Jainam M. Kothari Profile Picture

Jainam M. Kothari 773 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans