Popular Posts

Thursday 30 June 2011

Display & Edit methods in ax


Display Method:
                Take the new method in a table
display Name names()
{
    CustTable   custTable;
    ;
    return  CustTable::find(this.CustAccount).Name;
}
Then drag that method into the grid and set data source properties. In that field is non-editable.

Edit Method:
                Take the new method in the table
edit Name name(boolean _set , Name _name)
{
    Name    name    = _name;
    CustTable   custTable;
    ;
    if(_set)
    {
        if(name)
        {
            ttsbegin;
            custTable   = CustTable::find(this.CustAccount,true);
            custTable.Name  = name;
            custTable.update();
            ttscommit;
        }
    }
    else
    {
        name    = CustTable::find(this.CustAccount).Name;
    }
    return name;
}
Then drag that method into the grid and set data source properties. In that field is user edit it and accept the values to the user and save it CustTable.

No comments:

Post a Comment