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)

How to check/uncheck all checkbox in a form ?

(0) ShareShare
ReportReport
Posted on by 660

Hi,

 

I try to make a functionality for my buttons "Check/Uncheck" in a form that have a lot of checkbox.

Right now, all checkbox are AutoDeclaration=Yes and we have a method that list all controls and put change the value.

I want to change that. Don't want to change anymore the method each time we add or remove a control checkbox.

All the checkbox and my button are in the same tabPage. But in that tabpage, i have a couple of groups.

 

Someone can help me with that ? I checked the .control*() methods for now.

 

Thanks

 

*This post is locked for comments

I have the same question (0)
  • Martin Dráb Profile Picture
    237,990 Most Valuable Professional on at

    Hmm, so what do you want to achieve? Get a list of all checkbox-based controls on a tab page?

    If those controls are based on a table, you could create a field group with all required field a base the logic on it.

  • Community Member Profile Picture
    on at

    you can list the controls in a form using:

    element.design().controlCount()

    element.design().controlNum()

    I dont see how you can see whether or not a control is on a certain tabpage though.

    However, another way is using element.form(). This gives you the TreeNode from your (running!) form. With this you can use standard AOT treenode methods to find your tabpage using a path, and recursively scan all controls within this treenode to give you your controls that you want to enable/disable.

  • JFM Profile Picture
    660 on at

    I got it using controlCount, controlNum.

    ControlNum returns a objet "FormControl". After i can check if its a checkbox, a group, a tab, or anything else. (ex : if (classIdGet(myVariable) == classnum(FormCheckboxControl)..)

    My function use recursivity. If i find a group or tab, i call again my method to loop for each control inside.

    Martin Drab, this form is not link on a database. We use it to generate a lot of summary datas. We check all datas we want to generate for a period, and click a button.

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