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

Form Grid Mark in AX 2012

(0) ShareShare
ReportReport
Posted on by 692

Hi All,

I have  a question

For examples My Sales order contains 2 item lines.

P5.png

if user mark any record in grid  then only i wanted to display item id in  dialog box or info message

How can i achieve this.

Thanks,

Krishna

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Martin Dráb Profile Picture
    239,632 Most Valuable Professional on at

    Use MultiSelectionHelper class.

    MultiSelectionHelper helper = MultiSelectionHelper::construct();
    helper.parmDatasource(SalesLine_ds);
    
    salesLine = helper.getFirst();
    while (salesLine)
    {
        info(salesLine.ItemId);
        salesLine = helper.getNext();
    }
  • Verified answer
    Pir_Rana Profile Picture
    836 on at

    Hi,

    You can code on markChanged()  method on data source.

  • 5400 Profile Picture
    7,162 on at

    Please override selectionChanged method on data source

    if (Datasourcename_ds.anyMarked())
        {
            Datasourcename = Datasourcename_ds.getFirst(1);
            if(Datasourcename)
            {
              
                    Datasourcename_ds.mark(0);
                    info(Datasourcename.itemid);
             }
    }


    If you want multiple please use while and display it.

  • Hariharans87 Profile Picture
    36 on at

    Could you please explain me that why you want in the marked event because, the user may mark the item id for different purpose.

    Please refer this link for get the marked items basicax.blogspot.in/.../ax2012-x-code-to-access-marked-records.html

  • gsbsrk b Profile Picture
    692 on at

    Hi Martin,

    Thanks for your reply.

    My scenario after marking record in grid  immediately  i wanted to display item id in  dialog box or info message

    Your code is helpful for marking records in grid and if i click any button.

    Thanks,

    Krishna

  • gsbsrk b Profile Picture
    692 on at

    Hi Bhaskar,

    Thank you so much for your reply

    In datasource markchanged method i achieved above thing.

    from above code i used this line

    if (Datasourcename_ds.anyMarked())

       {

           Datasourcename = Datasourcename_ds.getFirst(1);

           if(Datasourcename)

           {          

                   info(Datasourcename.itemid);

            }

    }

    Thanks,

    Krishna

  • Martin Dráb Profile Picture
    239,632 Most Valuable Professional on at

    Well, that surely can happen only "after marking record in grid", so it meets the requirement and should be marked as the answer.

    Just joking :), I misunderstood your requirement. But it's also because you didn't describe it in much detail...

  • 5400 Profile Picture
    7,162 on at

    Np. It should work with selectionchanged() method also.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
CP04-islander Profile Picture

CP04-islander 24

#2
Michel ROY Profile Picture

Michel ROY 14

#3
Jagadabi Profile Picture

Jagadabi 6

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans