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)

get registration number

(0) ShareShare
ReportReport
Posted on by

Hi Guyz i want to get registration number and show Registration Number in Report of Customer can you tell me what is the relation between dirpartytable and custtable

this is my code 

DirPartyTable DirPartyTable;
DirPartyLocation DirPartyLocation;
taxRegistration taxRegistration;
CustTable custtable;

select * from DirPartyTable
where DirPartyTable.Name == "Brich company";

select * from DirPartyLocation
where DirPartyLocation.Party == dirPartyTable.RecId;

select registrationNumber
from taxRegistration
where taxRegistration.DirPartyLocation == dirPartyLocation.RecId;

//info(strFmt("reg %1",taxRegistration.RegistrationNumber));
info(strFmt(DirPartyTable.Name,taxRegistration.RegistrationNumber));

now i want to make relation between where DirPartyTable.Name == "Brich company";

i want registration number on behlf of name in my report of another one so can you guide me?

*This post is locked for comments

I have the same question (0)
  • Ali Zaidi Profile Picture
    4,657 on at

    Hi, Siddiqui, I test the code, It works for me, only difference, on Virtual Machine, Registration is attached on Primary address.

    static void Job5(Args _args)

    {

       DirPartyTable DirPartyTable;

    DirPartyLocation DirPartyLocation;

    taxRegistration taxRegistration;

    CustTable custtable;

    select * from DirPartyTable

    where DirPartyTable.Name == "Ali test test";

    select * from DirPartyLocation

    where DirPartyLocation.Party == dirPartyTable.RecId && DirPartyLocation.IsPrimary==boolean::true;

      // info(strFmt(DirPartyTable.Name));

    select registrationNumber

    from taxRegistration

    where taxRegistration.DirPartyLocation == DirPartyLocation.RecId;

    info(strFmt("reg %1",taxRegistration.RegistrationNumber));

    //info(strFmt(DirPartyTable.Name,taxRegistration.RegistrationNumber));

    }

    Hopes it helps

  • Community Member Profile Picture
    on at

    dera Ali raza bhai

    select * from DirPartyTable

    where DirPartyTable.Name == "Ali test test";

    how to get field value from Ax form to "Ali test test"

    Thanks

  • Ali Zaidi Profile Picture
    4,657 on at

    Hi, Siddiqui sahib, At very simple, you have to add stringEdit control on Form. And from its properties, Auto declaration as true. So control reference available in code. Then and button on form. On its click method. copy the above code. And Name portion replace with controlName.valueStr() or similar. Hopes it works

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 16

#2
GiacomoRovai Profile Picture

GiacomoRovai 4

#3
Douglas Noel Profile Picture

Douglas Noel 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans