Hi All,
How to get the tax identification number of a particular invoice account?
Thanks.
*This post is locked for comments
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)); }
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
Hi
Thanks for the help.
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
Hi,
Yes, I'm referring supplier tax identification number. How to get that using x++? Where is the TIN of supplier stored?
Thanks.
Please be more specific, invoice account could mean a range of different things.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156