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)

Code to delete marked transactions in a form's grid

(0) ShareShare
ReportReport
Posted on by 3,013

AX 2012 R3 CU10.

I have a grid in a form that is not a ListPart, so I want to enable a button that deletes the marked rows in a grid and then refreshes the grid.

I've tried this code in my button's clicked method, but it just does nothing:

void clicked()
{
    MyFormDataSource2_ds.deleteMarked();
}



*This post is locked for comments

I have the same question (0)
  • Suggested answer
    PA-22040759-0 Profile Picture
    6,194 on at

    That should work. The method is called many places in the standard application code. But if you only have marked one record for your test, it won't work. The pattern should be like this:

        ttsbegin;
    
        if (MyFormDataSource2_ds.anyMarked())
        {
            MyFormDataSource2_ds.deleteMarked();
        }
        else if (getFirstSelection(MyFormDataSource2_ds))
        {
            MyFormDataSource2_ds.delete();
        }
    
        ttscommit;
    
        MyFormDataSource2_ds.research(true);
    
    
    


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