Mark all records in a grid by clicking button and use it as a Switch in Ax 2012

METHOD 1:

public class FormRun extends ObjectRun
{
boolean val;
}

void clicked()
{
Bill_TabMethod bill;

super();

if(val==false)
{
while select bill// where bill.ItemName==”Watch”
{
Bill_TabMethod_ds.findRecord(bill);
Bill_TabMethod_ds.mark(true);
}
val=true;
}

else
{
while select bill// where bill.ItemName==”Watch”
{
Bill_TabMethod_ds.findRecord(bill);
Bill_TabMethod_ds.mark(false);
}
val=false;
}
}

METHOD 2:

public class FormRun extends ObjectRun
{
boolean val;
}

void clicked()
{
Bill_TabMethod bill;

super();

if(val==false)
{
bill = Bill_TabMethod_ds.getFirst(0);
while(bill)
{
Bill_TabMethod_ds.findRecord(bill);
Bill_TabMethod_ds.mark(true);
bill = Bill_TabMethod_ds.getNext();
}
val=true;
}
else
{
bill = Bill_TabMethod_ds.getFirst(1);
while(bill)
{
Bill_TabMethod_ds.findRecord(bill);
Bill_TabMethod_ds.mark(false);
bill = Bill_TabMethod_ds.getNext();
}
val=false;
}
}

Advertisements

One comment on “Mark all records in a grid by clicking button and use it as a Switch in Ax 2012

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s