AX 2012 Forms – Marking Records on a Form Data source

By Laura Lake | March 24, 2014

Ax 2012 forms – marking records on a form data source

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

Recommended Reading:

Stoneridge Software Selected for 2022 Microsoft US Partner Award – Dynamics 365 Business Central

Stoneridge Software is honored to be selected as a 2022 Microsoft US (MSUS) Partner Award winner for Dynamics 365 Business […]

Read the Article
6.29.22 Dynamics CRM

Reduce Manual Data & Increase Productivity with Dynamics 365 for Sales

Dynamics 365 for Sales has a ton of great features to help automate processes for you and your team to […]

Read the Article

Dynamics 365 Business Central Boolean Field Bug Temporary Fix

If you are a Dynamics 365 Business Central cloud (SaaS) customer who is using Edge or Chrome to run the […]

Read the Article

Using Non-Sequential Numbering to Prevent Locking In Your Dynamics 365 Business Central System

Running into locks in your system? Enable non-sequential numbering on your number series to prevent number series locking issues! As […]

Read the Article
6.24.22 Dynamics GP

Uncommonly Used Features: Setting Up Account Categories in Dynamics GP

This is the final part of my current series on Uncommonly Used Features in Dynamics GP. In this post, I […]

Read the Article

Increase User Productivity in Dynamics 365 Business Central with These 10 Tips

There are constantly evolving ways for you to increase user productivity in Dynamics 365 Business Central. Here are 10 tips […]

Read the Article

Star Tribune Lists Stoneridge as a Top 200 Workplace for 2022

Stoneridge Software’s emphasis on creating a positive and flexible culture has earned recognition as a top workplace in Minnesota. The […]

Read the Article
6.14.22 Dynamics GP

Uncommonly Used Features – Reconciling Sub-ledger to GL using the Reconcile Routines in Dynamics GP

As we continue the uncommonly used features series, with this post I want to show you how to reconcile your […]

Read the Article

Organize and Prioritize Your Resources with Dynamics 365 Field Service

As a manager, Dynamics 365 Field Service lets you optimize the use of your employees, their skillsets, and other resources […]

Read the Article

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