Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 Community / Forums / Finance forum / How to (dis)able dupli...
Finance forum

How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

(0) ShareShare
ReportReport
Posted on by 45

The question is simple like the scenario - trying to import a "main" customer and "sub" (delivery) customers with the same VAT numbers. For one of the legal entities I get an error that the Tax exempt number is already used with another customer:

pastedimage1566469327561v1.png

I would like to switch off this check. Any ideas how? I've already checked the General ledger parametersForeign trade parameters, etc..., but I couldn't find anything related.

Thank you!

  • Savichka01 Profile Picture
    10 on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    Hi, I am having the opposite problem I don't get a message if I enter the same VAT number in two different customers. I am talking about when entering the VAT number in the customer number. There is no overlap message. Do you know how can I set this up? Thanks

  • V_K Profile Picture
    45 on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    Hey nmaenpaa,

    great news - the Tax exempt number on the Invoice is generated from the main customer. So, no need of customization.

    Thank you!

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    And, in my opinion you can just set up the tax exempt number only on the invoice customer. So, please try it first before making any customizations. All invoice-related information will be initialized from the Invoice account.

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    You can disable the validation with extensions, by making the method always return true. However you would still see the warning infolog. To get rid of that, you would need to add bit more code, suppressing the infolog for the duration of the method. Also, I don't know if this would break some local legislation, you need to find it out if you are working with Italian customers.

    [ExtensionOf(tableStr(CustTable))]
    final class MYCustTable_Extension
    {
        public boolean checkVATNumUsed()
        {
            SysInfologLevel origInfologLevel = infolog.infologLevel(); // Capture current setting for infolog level
            infolog.setInfoLogLevel(SysInfologLevel::None); // Suppress infolog
            next checkVATNumUsed(); // You always need to call the standard logic...
            infolog.setInfoLogLevel(origInfologLevel); // Return infolog setup to original
            return true; // ....but you can ignore the return value and always return true
        }
    }
  • V_K Profile Picture
    45 on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    Hello nmaenpaa,

    I guess you just got the answer - I have issue exactly with Italy? Do you think it's possible for the code to be customized in order to allow duplicate values? And will this change be against the regulations baring in mind that all the duplicate Tax exempt numbers are related to the same main customer (all the delivery customers are just fake representation of the main one, having a different delivery address). Invoicing will be done on the main customer. Will the "Invoice account" link from the delivery customers to the main customer be enough for the proper Tax exempt number population on the delivery customer invoice? 

    Meanwhile, I will do some tests on this scenario.

    Thank you very much!

  • Verified answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    I can see that for Italy there is a check to prevent using of same Tax exempt number on many customers. So most likely it's a regulatory requirement.

    This code can be found in CustTable table:

        boolean checkVATNumUsed()
        {
            boolean    ret = true;
            CustTable  tmpCustTable;
            #ISOCountryRegionCodes
            if (SysCountryRegionCode::isLegalEntityInCountryRegion([#isoIT]) && this.VATNum)
            {
                select firstonly RecId from tmpCustTable
                    where tmpCustTable.RecId  != this.RecId  &&
                          tmpCustTable.vatNum == this.vatNum;
                if (tmpCustTable.RecId)
                {
                    ret = checkFailed(strFmt("@SYS79490",fieldPName(CustTable, vatNum)));
                }
            }
            return ret;
        }
  • V_K Profile Picture
    45 on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    That's already done. My issue is with the fact that I've already imported a lot of such customers in other legal entities (countries), but for a specific country I receive this error, which means that there should be a configuration per legal entity available for this duplicate check.

  • Suggested answer
    nmaenpaa Profile Picture
    101,158 Moderator on at
    RE: How to (dis)able duplicate check on Tax Exempt Numbers (VATs) in Dynamics 365 F&O?

    How about setting the main customer as Invoice account for the delivery customers, and importing Tax exempt number only for the main customer?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,349 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 233,029 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans