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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

FormCheckboxControl.checked(true) is not reflected on UI

(1) ShareShare
ReportReport
Posted on by
All i want is to check the checkboxControl that i have (MarkedControl) but nothing works and uncheck when i click unselect all button
 
-----------------------------------------
class SelectAllButton
{
    public void clicked()
    {
        MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
        super();
        selectionHelper.parmDataSource(ModuleTable_ds);
        ModuleTable  = selectionHelper.getFirst();
        if (ModuleTable.RecId)
        {
            while (EX_ModuleTable)
            {
                info(strFmt("Selected record is %1", EX_ModuleTable.Module));
                Info(int2Str(MarkedControl.value()));
                MarkedControl.checked(true);
                EX_ModuleTable = selectionHelper.getNext();
            }
        }
    }
}
--------------------------------------------------
class ClearAllButton
{
    public void clicked()
    {
        super();
        while (ModuleTable)
        {
            Info(int2Str(MarkedControl.value()));
            MarkedControl.checked(false);
        }
    }
}

 
 
I have the same question (0)
  • Anton Venter Profile Picture
    21,155 Super User 2026 Season 2 on at
    Can you give us more information about the form? How is the Mark column bound? There is probably an edit method with a collection object in the form. So you will have to use that object to "mark" each row. By the way, please format your code by using Insert Code Snippet, it makes the code easier to read.
  • Roy Saliba Profile Picture
    on at
    Thank you for your reply Anton,
    The mark column is checkbox column and is not related to the datasource it is on the form level
     
    -----------------------------------------
    class SelectAllButton
    {
        public void clicked()
        {
            MultiSelectionHelper selectionHelper = MultiSelectionHelper::construct();
            super();
            selectionHelper.parmDataSource(ModuleTable_ds);
            ModuleTable  = selectionHelper.getFirst();
            if (ModuleTable.RecId)
            {
                while (EX_ModuleTable)
                {
                    info(strFmt("Selected record is %1", EX_ModuleTable.Module));
                    Info(int2Str(MarkedControl.value()));
                    MarkedControl.checked(true);
                    EX_ModuleTable = selectionHelper.getNext();
                }
            }
        }
    }
    --------------------------------------------------
    class ClearAllButton
    {
        public void clicked()
        {
            super();
            while (ModuleTable)
            {
                Info(int2Str(MarkedControl.value()));
                MarkedControl.checked(false);
            }
        }
    }
     
  • Suggested answer
    Anton Venter Profile Picture
    21,155 Super User 2026 Season 2 on at
    Have a look at one of the standard forms like settling customer invoices to see how it's done.
  • Roy Saliba Profile Picture
    on at
    Okay thank you
  • Roy Saliba Profile Picture
    on at
    But in the forms provided by Microsoft, there's a lot of functions inside each others, and it is too complicated, my idea is simpler than that, anyways thank you!
  • Suggested answer
    Anton Venter Profile Picture
    21,155 Super User 2026 Season 2 on at
    The basic idea is to bind your checkbox form control (dataMethod property) to an edit method on the form. The edit method uses a Map (with form scope) to store and retrieve the Marked values for each row in the grid. The map is used as form record cache. In the set part of the edit method, you set the current value of the Marked field using the key of the current record. In the get part, you retrieve the Marked value using the key from the Map.
     
    The code below is untested and certainly not a complete edit method but it demonstrates the basic idea of what you should do.
     
    	NoYes ret;
    
    	if (_set)
    	{
    		mMapMarked.insert(_table.RecID, _marked);
    	}
    	else
    	{
    		if (mMapMarked.exists(_table.RecID))
    		{
    			ret = mMapMarked.lookup(table.RecID);
    		}
    	}
    
    	return ret;
    
     
  • Waed Ayyad Profile Picture
    9,214 Super User 2026 Season 2 on at
    Hi,
     
    What is the usage of mark checkbox control?
     
     
    Thanks,
    Waed Ayyad
  • Suggested answer
    Waed Ayyad Profile Picture
    9,214 Super User 2026 Season 2 on at
    Hi,
     
    Check the following blog on How to use edit methods to mark records:
     
     
     
    Thanks,
    Waed Ayyad
    If this helped, please mark it as "Verified" for others facing the same issue
     
  • Waed Ayyad Profile Picture
    9,214 Super User 2026 Season 2 on at
    Hi,

    Is your issue resolved?  If yes, mark the answers that helped you as verified.

    Thanks
    Waed Ayyad

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

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

#1
SajeedMullaji Profile Picture

SajeedMullaji 698

#2
Martin Dráb Profile Picture

Martin Dráb 330 Most Valuable Professional

#3
CU10121822-0 Profile Picture

CU10121822-0 310

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans