Error :- Dynamics AX form requires an active buffer
Here is the code for above explanation: -
Args argsForm;
FormRun formRun;
FormRun subformRun;
;
//Open Picking List form
argsForm = new Args(formstr(ProdJournalTable));
argsForm.record(ProdJournalTable::find(prodJournalTable.JournalId));
formRun = classFactory.formRunClass(argsForm);
formRun.init();
formRun.run();
//Now open sub-form (Production Journal Lines)
argsForm = new Args(formstr(ProdJournalTransBOM));
//Here you can mention the parent form instance as an active buffer
argsForm.caller(formRun);
argsForm.record(ProdJournalTable::find(prodJournalTable.JournalId));
subformRun = classFactory.formRunClass(argsForm);
subformRun.init();
subformRun.run();
formRun.close(); //Now close the parent form.
subformRun.wait(); //This halts your programme execution.
Here is the code for above explanation: -
Args argsForm;
FormRun formRun;
FormRun subformRun;
;
//Open Picking List form
argsForm = new Args(formstr(ProdJournalTable));
argsForm.record(ProdJournalTable::find(prodJournalTable.JournalId));
formRun = classFactory.formRunClass(argsForm);
formRun.init();
formRun.run();
//Now open sub-form (Production Journal Lines)
argsForm = new Args(formstr(ProdJournalTransBOM));
//Here you can mention the parent form instance as an active buffer
argsForm.caller(formRun);
argsForm.record(ProdJournalTable::find(prodJournalTable.JournalId));
subformRun = classFactory.formRunClass(argsForm);
subformRun.init();
subformRun.run();
formRun.close(); //Now close the parent form.
subformRun.wait(); //This halts your programme execution.