AX 2012 Forms – Marking Records on a Form Data source

By Laura Lake | March 24, 2014

I wanted to manipulate records in a grid, marking as needed and then reading the marked records. I was able to find many examples for AX 2012 Forms on how to read marked records on a data source, but I found no clear examples on how to mark them. In the interest of having everything in one place, here is sample code for both.

The grid’s data source is the CompanyInfo table

AX 2012 Forms

Mark all records:

public void selectall(boolean _select)

{

CompanyInfo     localCompanyInfo;

localCompanyInfo = this.getFirst();

while(localCompanyInfo)

{

this.findRecord(localCompanyInfo);

this.mark(_select);




localCompanyInfo = this.getNext();

}

}

Read marked records:

CompanyInfo     localCompanyInfo;

localCompanyInfo = this.getFirst(1); //get marked

while(localCompanyInfo)

{

//do something




localCompanyInfo = this.getNext()

}

OR:

for(localCoInfo = CompanyInfo_ds.getFirst(1);localCoInfo;localCoInfo = CompanyInfo_ds.getNext())

{

//do something

}

Related Posts

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X