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 :
Finance | Project Operations, Human Resources, ...
Answered

Clicked method paramters

(0) ShareShare
ReportReport
Posted on by 636

Hi Experts,

I have a requirement that I have created a button on my form where I need to process the records based on a condition  when the user press the button. I don't know how to select the records in the clicked methods (in other words arguments for clicked method). 

Example:- SalesLine form, I need to select first 5 items by comparing line number with my counter and process them to update something else.

how to select the records of the respective sales order in the clicked method of the button ?

void clicked()
{

SalesLine   salesline;

super();

while select forupdate salesline where salesline.linenum <= MyCounter

{

// do some update;

}

}

how to pass arguments to select only particular sales order, Thanks in advance

I have the same question (0)
  • Verified answer
    Gunjan Bhattachayya Profile Picture
    35,423 on at

    Hi AX Beginner,

    If you are on the sales order form, you can get order number using "salesTable.SalesId". You also won't be able to use the variable salesLine in the clicked method as SalesLine is also the name of the data source.

    But since you are updating records, it might be a better option to create an action menu item and pass the data source as an argument. You can take a look at CheckCrediLimit button as an example. You can check the menu item (as highlighted) and the class it calls to check credit limit.

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 653

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 463 Super User 2026 Season 1

#3
Syed Haris Shah Profile Picture

Syed Haris Shah 308 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans