Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ax7 form init method extension
class InventNonConformanceTableForm
{
[FormEventHandler(formStr(InventNonConformanceTable), FormEventType::Initialized)]
public static void InventNonConformanceTable_OnInitialized(xFormRun sender, FormEventArgs e)
{
Common common = sender.args().record();
CustTable custTable;
if (common is CustTable)
{
custTable = common;
info("FormEventType::Initialized - Selected CustAccount: " + custTable.AccountNum);
}
}
[PostHandlerFor(formStr(InventNonConformanceTable), formMethodStr(InventNonConformanceTable, init))]
public static void InventNonConformanceTable_Post_init(XppPrePostArgs _args)
{
FormRun fr = _args.getThis();
Common common = fr.args().record();
CustTable custTable;
if (common is CustTable)
{
custTable = common;
info("PostHandlerFor formMethodStr(InventNonConformanceTable, init) - Selected CustAccount: " + custTable.AccountNum);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment