0
votes

Inside AX2012 R3, when creating a new Return Order from the Return Order list view page (using the button in the Header), the SalesCreateOrder form opens and functions as expected.

Upon close of this form, however, instead of opening the newly created Order, instead the order that was selected in the grid is opening.

Several developers have made customization to this form, but none that (at first glance) appear relevant to this behavior.

Where would I find the behavior to open a form upon close of the SalesCreateOrder dialog?

2
Consider accepting an answer. - Jan B. Kjeldsen

2 Answers

1
votes

You can open the created order by changing the SalesCreateOrder.close method:

public void close()
{
    Args args = new Args(this); //Change here

    // Save user's customer search type
    MCRCustSearch::saveCustSearchType(mcrCustSearchType.selection());    
    if (salesTableType)
    {
        salesTableType.formMethodClose();
    }    

    //Change here -->
    args.record(salesTable);
    new MenuFunction(menuitemDisplayStr(SalesTable),MenuItemType::Display).run(args);
    //End of change <--    

    super();
}

You may have to change the called menuitem if called from Return order.

0
votes

Your understanding of how returns are created is wrong. A form isn't opened upon closing, it's opened upon creation.

When you do Ctrl+n or click to create a new return order, the ReturnTable form actually instantiates the SalesCreateOrder form eventually.

To see this, place a breakpoint in the init method of the ReturnTable at \Forms\ReturnTable\Methods\init and then try and create a new return order.