Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

how to write custom code on customer vat number field to validate the input data. in d365

(0) ShareShare
ReportReport
Posted on by 123
how to write custom code on customer vat number field to validate the input data.  in d365
  • André Arnaud de Calavon Profile Picture
    André Arnaud de Cal... 291,965 Super User 2025 Season 1 on at
    how to write custom code on customer vat number field to validate the input data. in d365
    Hi M R,
     
    For some countries, there is already a validation that can be enabled in settings. Can you tell for which country or countries you want to validate the VAT number?
  • Suggested answer
    Hana Xue Profile Picture
    Hana Xue Microsoft Employee on at
    how to write custom code on customer vat number field to validate the input data. in d365
    Hi,
    As a supplement:
    You can check the link below to learn how to validate your VAT number.
    https://dynamicsax-fico.com/2019/05/05/validate-vat-numbers/
    For field validation, you can check the link below:
    https://www.atnyla.com/qanswer/table-method-validatefield-in-d365/202/909
    Validations, default values, and unmapped fields - Finance & Operations | Dynamics 365 | Microsoft Learn

    Hope these will be helpful!
    Best Regards,
    Hana
  • Suggested answer
    Layan Jwei Profile Picture
    Layan Jwei 7,613 Super User 2025 Season 1 on at
    how to write custom code on customer vat number field to validate the input data. in d365
    Hi M_R,
     
    If I understood you correctly, you want to add some validation when someone tries to fill the customer VAT number. 
    Example, let's say you want to validate that when people fill this field, it needs to be not less than 5 characters. If that's the case, you can add code in the validateField method. 

    You can look at standard tables and check how validateField method is used.
     
    If you need more help, then please give us more details.
     
    Best Regards,
    Layan Jweihan

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 Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,965 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,817 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans