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 :
Microsoft Dynamics AX (Archived)

Mark all checkbox in Form grid

(0) ShareShare
ReportReport
Posted on by 209

Hi all,

i need help here, any input is appreciated.

in AR>all customers>Collect>Closed transaction editing

 5758.forum.png

i need to develop a button to select all and mark the checkbox.

but the checkbox is a data method in datasource, not a field, so im having a hard time.

Any input on how to do this is appreciated. Thanks.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    nmaenpaa Profile Picture
    101,160 Moderator on at

    You need to iterate all data source records in your code and call the edit method for each record with parameter Set = true.

  • Blue Wang Profile Picture
    on at

    Hi Chel,

    I used a piece of code before.

    I hope it will help you.

    //step 1: Declartion
            Map  SelectionMap;
    //step 2 : Add method
            Map  SelectedPost(){
                return SelectionMap;
            }
    //step : 3 Add methods in Form datasource
            edit NoYesId Selection(boolean _set, datasourceName _datasourcename,NoYesId  _value)
            {
              if(_set)
              {
                if(_value)
                {
                    SelectionMap.insert(_datasourcename.RecId,_datasourcename);
                }
                else
                {
                    SelectionMap.remove(_datasourcename.RecId);
                }
               }
               return SelectionMap.exists(_datasourcename.RecId);
             }
    //step 4 : clikced method to call SelectAll
           public void clicked()
           {
            super();
            element.SelectAllNew();
           }
    //step 5 : SelectAllNew methods
           public void SelectAllNew()
           {
            if(ChkSelectAll.value())
              {
                Datasourcename_ds.selection(true,Datasourcename,NoYes::Yes);
              }
            else
              {
                Datasourcename_ds.selection(true,Datasourcename,NoYes::No);
              }
            Datasourcename_ds.research(true);
           }


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 > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans