Hi,
We had some customization done in SysOperationTemplateForm in 2012, which we are trying to deal with in Dynamics 365. Customization we had done in CloseOK() method of the form. Which I am tying to handle by writing a pre event handler. As below-
[PreHandlerFor(formStr(SysOperationTemplateForm), formMethodStr(SysOperationTemplateForm, closeOk))]
public static void SysOperationTemplateForm_Pre_closeOk(XppPrePostArgs args)
{
FormRun sender = args.getThis(); sender.
if (this.controller().checkCloseDialog())
{
// <CMC>
if (CMCSysOperationTemplateForm::cmcFMNameOfCreatePostBatchChanged())
{
throw error("@CMC1326");
}
if (ledgerJournalCreatePostBatch && batchJob)
{
ttsBegin;
batchJob.selectForUpdate(true);
batchJob.recurrenceData = this.controller().batchInfo().parmRecurrenceData();
batchJob.doUpdate();
ttsCommit;
sender.close();
}
}
}
I am getting error on the code which I have highlighted in bold. I am not able to get controller for the form.
Can you please give me some information on how to get the controller ?