Saturday, November 21, 2015

How to open the Child form using X++

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));
        formRun = classFactory.formRunClass(argsForm);

        //Now open sub-form (Production Journal Lines)
        argsForm = new Args(formstr(ProdJournalTransBOM));
        //Here you can mention the parent form instance as an active buffer

        subformRun = classFactory.formRunClass(argsForm);
        formRun.close(); //Now close the parent form.
        subformRun.wait(); //This halts your programme execution.

No comments:

Post a Comment

How to enable the dimension fields based on the Item selected on the form.

[Form] public class KMTShipFromWarehouses extends FormRun {     InventDimCtrl_Frm_EditDimensions        inventDimFormSetup;     /// &l...