Skip to content

Instantly share code, notes, and snippets.

@ztirom
Created November 1, 2017 12:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ztirom/445d03131fa51ce1a75385178eb99336 to your computer and use it in GitHub Desktop.
Save ztirom/445d03131fa51ce1a75385178eb99336 to your computer and use it in GitHub Desktop.
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