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

VAT number validation fails since last week

(1) ShareShare
ReportReport
Posted on by 24

Good morning forum,

Start last week we have an issue with the VAT validation. When executed (by entering a valid VAT in a customer card) we get an XML error.

It states that the call is not successful because System.Xml.XmlDocument.Load has failed. I've looked at the operation of the service http://ec.europa.eu/taxation_customs/vies/services/checkVatService and that seems all in order when called from Postman. I looked also at the template that is used for this call, but can't find a way to see the actual template that is used in this call.

Do any of you experience the same problem?

pastedimage1660546477584v1.png

I have the same question (0)
  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    From some days the service doesn't accept Content-Type multipart/form-data; charset=utf-8.
    The problem can be fixed temporarily as follows:
     
    [EventSubscriber(ObjectType::Codeunit, Codeunit::"VAT Lookup Ext. Data Hndl", 'OnSendRequestToVatRegistrationServiceOnBeforeSendRequestToWebService', '', false, false)]
    local procedure VATLookupExtDataHndl_OnSendRequestToVatRegistrationServiceOnBeforeSendRequestToWebService(var SOAPWebServiceRequestMgt: Codeunit "SOAP Web Service Request Mgt."; var TempBlobBody: Codeunit "Temp Blob")
    begin
    SOAPWebServiceRequestMgt.SetContentType('text/xml; charset=utf-8');
    end;

  • J-Philippe Profile Picture
    10 on at

    Same problem and your solution does work.

    Thank you.

  • Raymond Roesink Profile Picture
    24 on at

    Hi Stefano, I understand that you use this code to overrule/amend the existing code that is triggered by this event. I'm fairly new to BC programming but I think you put this in an AL extension and load it in Dynamics?

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Yes you need to create an AL extension to apply the above fix.

    Microsoft is aware of this problem, no ETA for an official fix now (so recommendation is to fix it as per my answer above).

  • RicoTrobisch Profile Picture
    10 on at

    Hi Stefano,

    thx for this workaround. Unfortunately this Event doesn't exist in older BC OnPrem versions. :(

    At least I can fix this for my Saas Customers. ;)

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,166 Most Valuable Professional on at

    Solution for older NAV versions is described here (it’s basically the same):

    www.beyond365.de/.../fix-online-validation-of-vat-registration-nos-for-older-versions

  • RicoTrobisch Profile Picture
    10 on at

    We have on BC V18 OnPrem Customer. The mentioned Eventpublishe doesn’t exist and we don’t want to customize the Base App.

  • Fabienne LE ROCH Profile Picture
    5 on at

    Good afternoon;

    Exact same issue and message when trying to check VAT for EU (worked before) both for customers and vendors cards.

    The issue was forwarded to our BC support partner, hoping for a quick fix, because we fear it may jeopardize the sepa paying slip.

    thanks,VIEs-Check-in-BC_5F00_Capture-d_1920E900_cran-2022_2D00_08_2D00_17-145601.png

  • AntonisK Profile Picture
    260 on at

    For some bc on prem versions ( like v16 ) where the event is not available but its not NAV which is easier to modify the base app , is there any other way to temporarily fix this bug without having to modify the base app?

    Adding NorthW, yzhums  in the conversation as well!

  • Suggested answer
    YUN ZHU Profile Picture
    95,329 Super User 2025 Season 2 on at

    Hi, I'm sorry I haven't tried it.
    You can copy the original button and create a new one. But since some local methods can't be called, I don't know if this is possible without trying it.

    I hope this will give you some hints.

    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

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

#2
Jainam M. Kothari Profile Picture

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

#3
YUN ZHU Profile Picture

YUN ZHU 1,153 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans