Monday 16 January 2012

Writing a display method in Ax 2009

Hi friend we are going  learn about the display method in Ax 2009 . We have a table say Table1. We have to display a field say Field value in Table1,which is coming from field2 from Table2.Say we have a common field called Cfield ,based on the value of Cfield the value of field we have to display field2 value in Table1.
Create a new method on Table1 write the code below,

// display method()
display Field2 field2()
{
    return this.Table2(this.Cfield).field2;
}
create a new method in Table1 and write the code below,

Table2 table2(Cfield cfield = this.cfield,
                                   boolean _forUpdate = false)
{
    return Table2::find(Cfield,_forUpdate);
}
Now drag drop the display method to the form of Table1
We we change the common field value the field value changes, Dont forget to change the properties of dragged form control.
                                                                Vivek Chirumamilla


No comments:

Post a Comment