initFrom method in axapta
Tables that are related to each other share the data that make up the relationship and possibly also other information. When creating new records in the 'many' table in a one-to-many relationship you can create initFrom methods that set the common fields in the table.
It can also be used to enter the values in fields in a table from another table.
The next example is taken from the BOMTable and shows how it initiates the ItemId and ItemGroupId fields in the BOMTable from the corresponding fields in the inventTable.
Tables that are related to each other share the data that make up the relationship and possibly also other information. When creating new records in the 'many' table in a one-to-many relationship you can create initFrom methods that set the common fields in the table.
It can also be used to enter the values in fields in a table from another table.
The next example is taken from the BOMTable and shows how it initiates the ItemId and ItemGroupId fields in the BOMTable from the corresponding fields in the inventTable.
void initFromInventTable(InventTable table)
{
this.bomId = table.ItemId;
this.ItemGroupId = table.ItemGroupId;
}