Dataeventhandlers in table
:
1. Create new class with final
keyword, suffixed _Extension and add following method.
2. Decorate with ExtensionOf() attribute.
2. Decorate with ExtensionOf() attribute.
Example
:
[ExtensionOf(tableStr(TableName)]
final class TableNameEventHandler
{
}
OnInserted eventhandler
[DataEventHandler(tableStr(TableName), DataEventType::Inserted)]
public static void TableName_onInserted(Common sender, DataEventArgs e)
{
ValidateEventArgs event =
e as ValidateEventArgs;
TableName localbuffer =sender as TableName; //get
current record from sender
//code here
}
Pre and Post eventhandlers in table :
Create any normal class and add
following method.
Initvalue pre-eventhandler
// pre-event handler for initvalue
[PreHandlerFor(tableStr(TableName), tableMethodStr(TableName, initValue))]
public static void TableName_Pre_initValue(XppPrePostArgs args)
{
TableName localbuffer = args.getThis() as TableName; //get current record from args
//code here
}
Initvalue post-eventhandler
//post-eventhandler for initvalue
[PostHandlerFor(tableStr(TableName), tableMethodStr(TableName, initValue))]
public static void TableName_Post_initValue(XppPrePostArgs args)
{
TableName localbuffer = args.getThis() as TableName; //get current record from args
//code here
}