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 :
Finance | Project Operations, Human Resources, ...
Answered

changing a form grid range based on a comboBox

(0) ShareShare
ReportReport
Posted on by 1,967

i have a form with a grid and a combo box that has 3 different values

What i want is, whenever i change this combo box value, i want the grid to change the records it shows (change range)
what i did works the first time i open the form and modify the combo box to it's different values however if i try and click on the values again it stops working

here's what i did

[Control("ComboBox")]
class ComboBoxControl
{
    /// 
    ///
    /// 
    /// 
    public boolean modified()
    {
        boolean ret;
        ret = super();

        element.setButtonAccess();

        tableX_ds.executeQuery();


        return ret;
    }
}



[DataSource]
class tableX
{
    /// 
    ///
    /// 
    public void executeQuery()
    {
        QueryBuildDataSource qbds;
        qbds = this.query().dataSourceTable(tableNum(tableX));
        if(qbds)
        {
            qbds.addRange(fieldNum(tableX, Enum1)).value(queryValue(ComboBoxControl.valueStr()));
        }
        super();
    }

}

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

    Your code adds more and more ranges each time it's executed. That's why it doesn't work.

    Try SysQuery::findOrCreateRange function (search the web if you need examples).

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 > Finance | Project Operations, Human Resources, AX, GP, SL

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 456 Super User 2025 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 429 Most Valuable Professional

#3
BillurSamdancioglu Profile Picture

BillurSamdancioglu 239 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans