2 Aralık 2011 Cuma

AXAPTA edit method sample

Edit method let us show a field of another table and tie it with a field of our table. In this sample ServiceObjectId fields value changes related with ItemId updates. We get ServiceObjectId fields value, put ItemId which has this ServiceObjectId value. When ItemId changed we update ServiceObjectId value.


edit ItemId EditItemId(boolean set, ItemId _ItemId)
{
    ItemId ret;
    ;

    if (set)
    {
        this.ServiceObjectId =
            SMAServiceObjectTable::findItem(_ItemId).ServiceObjectId;
    }
    else
    {
        ret = SMAServiceObjectTable::find(this.ServiceObjectId).ItemId;
    }
    return ret;
}

Set boolean value selects if editmethod will work for update or just display. If set true it's mean second parameter (in this case _ItemId ) filled from user. Else editmethod value cames from related field value.

Hiç yorum yok:

Yorum Gönder