Skip to main content

Notifications

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

  • Mahmood Ali963 Profile Picture
    Mahmood Ali963 20 on at
    RE: Customer TAX Registration Number X++ Code

    Thanks!

  • Mahmood Ali963 Profile Picture
    Mahmood Ali963 20 on at
    RE: Customer TAX Registration Number X++ Code

    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

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…

Vahid Ghafarpour – Community Spotlight

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

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,162 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans