HI Bader814,
Add these codes to your class
[ExtensionOf(tableStr(InventTable))]
final class InventTableMy_Extension
{
public void myDefaultPurchModel()
{
// This would have partner specific logic to initialize the new field.
this.PurchModel = NoYes::Yes;
}
}
class InventTableMy_EventHandler
{
[DataEventHandler(tableStr(InventTable), DataEventType::Inserting)]
public static void InventTable_onInserting(Common sender, DataEventArgs e)
{
InventTable inventTable = sender as InventTable;
// Call the method as if it was defined directly on InventTable.
inventTable.myDefaultPurchModel();
}
}
The result like this:

Best Regards
Tom Cai