Skip to main content

Notifications

Microsoft Dynamics AX (Archived)

Tax identification Number

Posted on by 180

Hi All,

How to get the tax identification number of a particular invoice account?

Thanks.

*This post is locked for comments

  • Suggested answer
    Chaitanya Golla Profile Picture
    Chaitanya Golla 17,225 on at
    RE: Tax identification Number

    Hi,

    TaxRegistration table has a static method getTaxRegistrationFromCust to get the taxRegistration for a given customer account and same code can be used for Vendor account as below.

    static void AXC_VendorTIN(Args _args)
    {
       DirPartyTable                           dirPartyTable;
       DirPartyLocation                        dirPartyLocation;
       TaxRegistration                         taxRegistration;
       VendTable                               vendTable;
       TaxRegistrationTypeApplicabilityRule    taxRegistrationTypeApplicabilityRule;
       TaxRegistrationType                     taxRegistrationType;
       VendAccount   _vendAcc = "XYZ"; // Specify vendor account
       TransDate     _invoiceDate  = today();
       RecId         _regTypeRecId;
       
        
        select firstonly validTimeState(_invoiceDate) RegistrationNumber from taxRegistration // Specify invoice date,as taxRegistration table has ValidTimeStateFieldType to Yes
           exists join taxRegistrationTypeApplicabilityRule
           where taxRegistration.TaxRegistrationTypeApplicabilityRule == taxRegistrationTypeApplicabilityRule.RecId
               exists join taxRegistrationType
               where taxRegistrationTypeApplicabilityRule.TaxRegistrationType == taxRegistrationType.RecId
                  // && taxRegistrationType.RecId == _regTypeRecId
                       exists join dirPartyLocation
                       where taxRegistration.DirPartyLocation == dirPartyLocation.RecId
                          && dirPartyLocation.IsPrimary == NoYes::Yes
                           exists join dirPartyTable
                           where dirPartyLocation.Party == dirPartyTable.RecId
                               exists join vendTable
                               where vendTable.Party == dirPartyTable.RecId
                                   && vendTable.AccountNum == _vendAcc;
        
        info(strFmt("Registration number: %1", taxRegistration.RegistrationNumber));
    }


    
    
  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Tax identification Number

    Hi ron_ron,

    If the answer/s given addressed your concern please mark as such, so others can benefit from the answer.

    Best regards,

    Edmond

  • ron_ron Profile Picture
    ron_ron 180 on at
    RE: Tax identification Number

    Hi

    Thanks for the help.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Tax identification Number

    Hi ron_ron,

    Tax Identification Number (TIN) is being used by Legal entities, Vendor and Customer levels.  If you are looking for TIN, Sukrut is right, it is found under TaxRegistration table.  But if you want to find the TIN for a particular invoice, you must go to the specific Vendor or Customer associated with it and then got to the Edit tax registration and see the specific TIN defined under Tax registration quicktab.

    Hope this helps.

    Best regards,

    Edmond

  • ron_ron Profile Picture
    ron_ron 180 on at
    RE: Tax identification Number

    Hi,

    Yes, I'm referring supplier tax identification number. How to get that using x++? Where is the TIN of supplier stored?

    Thanks.

  • Vilmos Kintera Profile Picture
    Vilmos Kintera 46,149 on at
    RE: Tax identification Number

    Please be more specific, invoice account could mean a range of different things.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans