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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Answered

How do I override the active method to check if the selected lines have the same WHS?

(0) ShareShare
ReportReport
Posted on by 106

For starters, I'm new to AX and it's possible that what I'm going to ask is very easy...

I have to check if the selected lines have the same WHS and only in this case the button should become active. How do I do this on the active method? Do I need to use MultiSelectionHelper or table buffer? I also have to check that the number of selected lines is less than or equal to a parameter. This is my Form.

pastedimage1675671870843v1.png

I have the same question (0)
  • Verified answer
    GirishS Profile Picture
    27,827 Moderator on at

    Hi Pavel loana,

    Yes, you need to make use of the "MultiSelectionHelper" class to get all the selected lines from the grid. Try adding the code on the active method of the form datasource - Get the selected lines using "MultiSelectionHelper" - Validate the lines and enable/disable the button based on that

    My suggestion will be instead of adding a code on the form datasource active method to disable the button - Add the validation on the button clicked method of the "Create purchase order" and "Create purchase order copy".

    If the validation fails throw info or waring message - If the validation is success you can go ahead and call your required methods for the creation of purchase orders.

    Thanks,

    Girish S.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 467 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 420 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 241 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans