SBX - Search With Button

SBX - Forum Post Title

Applying range to temp table within a form

Microsoft Dynamics AX Forum

Jacobh2 asked a question on 13 Sep 2018 3:35 PM
My Badges

Question Status

Verified

I have grid within a form that is populated via a temp table. Using Ctrl + g, I can filter my results within the grid. The action pane on the grid has buttons (Receive, Select all, Clear all, Show all selected). What I believe is occurring is that after I filter using the ctrl g these buttons aren't taking into consideration the filter, but instead applying it to the entire temp table. 

The issue is that I need to be able to filter by serial number and then receive just for that serial number. What is happening however, is that the entire table is being received. The process is filter by serial number ->click select all -> then receive.

I believe the issue is within the select all part. Here is the code within the clicked method for the select all button:

 

void clicked()
{
super();

element.lockWindowUpdate(true);
ReceivingDashboardTmp::selectAll(receivingDashboardTmp, receivingDashboardDetailTmp, receivingDashboardInstanceCovTmp);
receivingDashboardTmp_ds.research();
element.showSelected();
element.lockWindowUpdate(false);
}

Is there some way to apply the serial number range (or any range for that matter) to this chunk of code? Do I need to loop through all the rows within the datasource query?

Reply
Rustem Galiamov responded on 13 Sep 2018 3:42 PM
My Badges

Hi Jacobh2!

Which is the version of AX? Is this AX 2012? Is this a custom form or standard?

Reply
Nikolaos Mäenpää responded on 13 Sep 2018 3:42 PM
Suggested Answer

Doesn't every grid in the system have a built in "Select all" functionality that you could use? Why did you create a new column for just selecting records? I think your problem can be solved by using the standard functionality.

Reply
Jacobh2 responded on 13 Sep 2018 3:46 PM
My Badges

AX 2012 and a custom form

Reply
Nikolaos Mäenpää responded on 13 Sep 2018 3:50 PM
Suggested Answer

Any grid has this feature, no matter if your form is custom or not. Try to click the square in the top left corner of the grid. It will select all records that are shown with current query.

Then you can use MultiSelectionHelper class to iterate the selected records and do what you need to do with them.

Reply
Jacobh2 responded on 13 Sep 2018 4:02 PM
My Badges

This grid doesn't seem to have that. Is there a property or method somewhere that I need to be including? Sorry for the confusion

Reply
Rustem Galiamov responded on 13 Sep 2018 4:18 PM
My Badges
Verified Answer

You don't need any property or method. As Nikolaos Mäenpää mentioned, any grid has this feature. You only need to set property of multi select on Recieve button. About MultiSelectionHelper class check this link: https://docs.microsoft.com/en-us/dynamicsax-2012/developer/multiselection-design-pattern

Reply
Rustem Galiamov responded on 13 Sep 2018 4:18 PM
My Badges
Verified Answer

You don't need any property or method. As Nikolaos Mäenpää mentioned, any grid has this feature. You only need to set property of multi select on Recieve button. About MultiSelectionHelper class check this link: https://docs.microsoft.com/en-us/dynamicsax-2012/developer/multiselection-design-pattern

Reply
Nikolaos Mäenpää responded on 13 Sep 2018 3:42 PM
Suggested Answer

Doesn't every grid in the system have a built in "Select all" functionality that you could use? Why did you create a new column for just selecting records? I think your problem can be solved by using the standard functionality.

Reply
Nikolaos Mäenpää responded on 13 Sep 2018 3:50 PM
Suggested Answer

Any grid has this feature, no matter if your form is custom or not. Try to click the square in the top left corner of the grid. It will select all records that are shown with current query.

Then you can use MultiSelectionHelper class to iterate the selected records and do what you need to do with them.

Reply

SBX - Two Col Forum

SBX - Migrated JS