Select All record using checkbox in Ax 2009

selectall

CODE

public class FormRun extends ObjectRun
{
BillTableCheckBox ct;
}

public void init()
{
super();
Selectall.clicked();
}

public void close()
{
super();
// breakpoint;

Selectall.clicked();

}

public void clicked()  //Selectall checkbox
{
// CheckboxTest ct;
// BillTableCheckBox ct;

super();
ttsbegin;
while select forupdate ct
{

if(Selectall.value()==true)
{
ct.NoYesId=boolean::true;
}
else
{
ct.NoYesId=boolean::false;
}
ct.update();
}

BillTableCheckBox_ds.executeQuery();
ttscommit;
}

public boolean modified()  //table checkbox
{
boolean ret;
// BillTableCheckBox ct;
int count1;
int count2;
ret = super();
while select forupdate ct
{
if(BillTableCheckBox_NoYesId.value()==boolean::false)
{
selectall.checked(false);
// count2=0;
}
else if(BillTableCheckBox_NoYesId.value()==boolean::true)
{
BillTableCheckBox_ds.research();
select count(Recid) from ct;
count1=ct.RecId;
while select ct where ct.NoYesId==boolean::true
{
count2++;
}

if(count1==count2)
{
selectall.checked(true);
}
else
{
selectall.checked(false);
// count2=0;
}

}
}
return ret;
}

Advertisements

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