[DataEventHandler(tableStr(CustTable), DataEventType::Inserting)]
public static void CustTable_onInserting(Common sender, DataEventArgs e)
{
CustTable custTable = sender as CustTable;
custTable.inventSiteId = InventParameters::find().DGS_MainInventSiteId;
CustTable.InventLocation = InventParameters::find().DGS_MainInventLocationId;
if(!CustTable.CustGroup)
CustTable.CustGroup = THK_FileInterfaceParameters::find().CustGroupId;
if(!CustTable.DGS_CustNature)
CustTable.DGS_CustNature = THK_FileInterfaceParameters::find().DGS_CustNature;
}
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PreHandlerFor(tableStr(CustTable), tableMethodStr(CustTable, validateWrite))]
public static void CustTable_Pre_validateWrite(XppPrePostArgs args)
{
CustTable custTable = args.getThis() as CustTable;
if(!CustTable.CustGroup)
CustTable.CustGroup = THK_FileInterfaceParameters::find().CustGroupId;
if(!CustTable.DGS_CustNature)
CustTable.DGS_CustNature = THK_FileInterfaceParameters::find().DGS_CustNature;
}
In Table Datasource Events --> right click on Init Value--> Copy Post Event Handlers
Create new Class and below code
Table Method Event Handler
class test_PurchTableEventHanlders
{
/// <summary>
///
/// </summary>
/// <param name="args"></param>
[PostHandlerFor(tableStr(PurchTable), tableMethodStr(PurchTable, initValue))]
public static void PurchTable_Post_initValue(XppPrePostArgs args)
{
PurchTable purchTable = args.getThis() as PurchTable;
purchTable.test_PrintNote=NoYes::Yes;
}
}