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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

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

How can select multiple lines in a checkbox using x++

(0) ShareShare
ReportReport
Posted on by 45

Here the multiselect option is not working.when select a header record the corresponding line should visible.Please help to fix this.

I have the same question (0)
  • GirishS Profile Picture
    27,833 Moderator on at

    Hi Deepak,

    If you have proper relation between tables, you will get filter automatically.

    Otherwise add range on the line grid with the value from the header grid in the execute query method of line DataSource.

    Also check whether you have set the join source property on the line DataSource to the header DataSource.

    Thanks,

    Girish S.

  • Suggested answer
    Mohit Rampal Profile Picture
    12,565 Moderator on at

    Hi Deepak, I think Multi select on header will not display all relevant lines automatically. You need to write code for it.

    Please check this article

    dev.goshoom.net/.../

  • deepak31 Profile Picture
    45 on at

    I tried this.but still my requirement not satisfied.

    I have a simple form with two DataSources, SalesTable and SalesLine, with SalesLine joined to SalesTable. There is a header and lines grid. The header grid has property MultiSelect = Yes

    When I select 3 SalesTable records from the grid, is there a way to make it display all of the SalesLine records in the lower grid from the three selected SalesTable records in some native style?

    Any one can share the code for this.

  • GirishS Profile Picture
    27,833 Moderator on at

    You need to use mutiselect helper class to get the selected records and add its as range to the SalesLine table.

    Add the below code in the active method of the SalesTable DataSource.

    MutliselectHeper helper = MultiselectionHelper:;construct();
    helper.parmDatasource(SalesTable_ds);
    SalesTable salesTable;
    salesTable = helper.getFirst();
    while(salesTable.RecId != 0)
    {
        QueryBuildRange qbr = SalesLine_ds.queryBuildDatasource().addRange(fieldnum(SalesLine, SalesId));
        qbr.value(queryRangeConcat(qbr.value(),salesTable.SalesId));
        salesTable = helper.getNext();
    }

    Thanks,

    Girish S.

  • deepak31 Profile Picture
    45 on at

    public int active()
            {
                int ret;
                MultiSelectionHelper helper = MultiselectionHelper::construct();
                helper.parmDatasource(SalesTable_ds);
                SalesTable salesTableLocal;
                salesTableLocal = helper.getFirst();
                while(salesTableLocal.RecId != 0)
                {
                    QueryBuildRange qbr = SalesLine_ds.queryBuildDatasource().addRange(fieldnum(SalesLine, SalesId));
                    qbr.value(queryRangeConcat(qbr.value(),salesTableLocal.SalesId));
                    salesTableLocal = helper.getNext();
                }
                
                ret = super();
            
                return ret;
            }
    

    sir i tried in this way but still it  is not working...iam not getting all the lines for selected hedaers.......

  • GirishS Profile Picture
    27,833 Moderator on at

    Try the same code in the executeQuery method of the SalesLine DataSource before super class.

    Thanks,

    Girish S.

  • GirishS Profile Picture
    27,833 Moderator on at

    Also, on the SelectionChanged method of SalesTable DataSource call SalesLine_ds.executeQuery()

    Thanks,

    Girish S.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 545 Super User 2026 Season 1

#2
Giorgio Bonacorsi Profile Picture

Giorgio Bonacorsi 408

#3
Adis Profile Picture

Adis 267 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans