CheckBox in AX 2012

Hi i have added a checkbox field in my form how do i get it ticked by default, is there any property i need to change

or i need to write a piece of code.

Is the checkbox bound to a data source field or is it an unbound control?

Yes the checkbox is bound to DS

you can write this in the field control methods.

CheckBoxControl.Checked(tue);

Thanks … Could you be more specific anand do i write it on Active Method is that what you wan to say?

If it’s bound to a data source, you have to set the value to the table field, e.g. MyTable.MyField = true.

Where to put it depends on what you need to achieve. active() or initValue() are two of possible places.

Hi Vinesh,

I think, the better option, you can set the value in the intiValue method. If you need in table level then use table intiValue. If you need in form level then override the form datasource intiValue. Below I five you for table level.

public

super();

voidinitValue()

{

this.Active = NoYes::Yes;

//tableName.Active = NoYes::Yes; //For form level

}

Thanks,

Hari

Hi Vinesh,

I think, the better option, you can set the value in the intiValue method. If you need in table level then use table intiValue. If you need in form level then override the form datasource intiValue. Below I five you for table level.

public void initValue()
{
super();
this.Active = NoYes::Yes;
//tableName.Active = NoYes::Yes; //For form level
}

Thanks,
Hari

Yes you can write that in Active method of the form.

Thank You all for your time…i have achieved what i needed.