web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Customer TAX Registration Number X++ Code

(0) ShareShare
ReportReport
Posted on by 20

Hi,

Can anyone organised my below x++ code, I am new to x++ & would like to get TRN in SalesInvoiceDP as i can achieve it using below but would like to optimize it.

 

select  * from custable

      where custable.AccountNum==salesTable.InvoiceAccount;

      select *From dirpartytable

     where dirpartytable.RecId==custable.Party;

      select *From dirpartylocation

      where dirpartylocation.Party==dirpartytable.RecId && dirpartylocation.IsPrimary==1;

      select RegistrationNumber from taxregistration

      where taxregistration.DirPartyLocation == dirPartyLocation.RecId && taxregistration.ValidTo>=today();

Thanks in advance.

Regards

Mahmood

*This post is locked for comments

I have the same question (0)
  • Mahmood Ali963 Profile Picture
    20 on at

    Hi Crispin,

    Thank you very much! it works.

    salesInvoiceHeaderFooterTmp.LHGCustTRN = TaxRegistration::getTaxRegistrationNumberFromCust(_custInvoiceJour.OrderAccount,_custInvoiceJour.InvoiceDate,TaxRegistrationType::findByType("UAE TRN").recid);

    Can you please tell me if any such method available for vendor also.

    Thanks

    Mahmood

  • Mahmood Ali963 Profile Picture
    20 on at

    Thanks!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Joris dG Profile Picture

Joris dG 5

#2
Sagar Suman Profile Picture

Sagar Suman 2 Super User 2026 Season 1

#2
Alexey Lekanov Profile Picture

Alexey Lekanov 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans