Tuesday, November 2, 2010

Object 'FormRun' could not be created


Issue & Cause:
When opening report from Ax, if you are coming across this error, the main reson might be args are not getting passed from Form or to formfrom classes.

Solution:

Check the main method , it should be using client keyword, since args were passed from client.

Example : Public client static void main(Args _args)

1 comment:

  1. Hello,
    In dynamics ax 2012 “The FormRun object could not be created”
    code:
    void GNP_VendInvoiceJourAddData_Clicked(FormButtonControl _formButtonControl)
    {
    DictTable dictTable;
    Form formAddData;
    FormBuildDataSource fbDatasource;
    FormRun formRun;
    Args args;
    ;
    dictTable = new DictTable(tableNum(GNP_VendInvoiceJourAddData));
    formAddData = new Form();
    formAddData.name(“GNP_VendInvoiceJourAddData”);

    fbDatasource = formAddData.addDataSource(dictTable.name());
    fbDatasource.table(dictTable.id());
    args = new Args();
    args.object(formAddData);
    formRun = classFactory.formRunClass(args);
    formRun.init();
    formRun.run();
    formRun.detach();
    }

    stop code in “FormRun formRunClass(xArgs args)”
    Please help.

    ReplyDelete