
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.
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.