Hi D365FO user,
Can you elaborate on the business requirement here? Do you need to e.g. refresh the data on the caller form after execution of the dialog?
It isn't impossible, but challenging. If the action menu item is a button directly on the form without x coding, then the form will be opened independently. You can in this case create a method on the caller form and call this method from the new opened form to tell about the outcome or perform some actions before it really gets closed. When opening the dialog form you then need to fetch the caller form object to be able to achieve this.
I created a small example myself in the past (AX2012) to update a certain string control on the caller form. On caller form, I had this method:
public void updateString(str _string)
{
stringVariable = _string;
StringEdit.text(stringVariable);
}
On the dialog form you can declare an Object (named callerForm in this example) and fetch the form object.
public void init()
{
super();
callerForm = this.args().caller();
}
On several places, you can now interact with methods created on the caller form. E.g. on closing the form, I did call the method to update the string control. You can try to achieve the same with coding on the closedOK() method.
public void close()
{
if (callerForm)
{
callerForm.updateString(StringEdit.text());
}
super();
}