Code unable to interpret a Dialog class instantiate Statement in AX 2012

One of the class Methods in Ax which is called from my business connector includes a Dialog dlg=new Dialog(“some string”)statement; which is throwing an error : "A DialogStartGrp group is missing from the form . In this group dialog controls are added "

I tried accessing the same method from an AX job and the Dialog declaration statement passes fine. The error is only when the statement is hit from VS.

Is there any way to handle this ? It would be of great help if anyone could suggest workarounds

Hi,

When the call is made from Business Connector, it doesn’t accepts the popup forms/dialogs and it may crash. Hence when you are constructing the dialog, add a default tab page, mainformgroup etc…and initialize the values which you need to process in the dialog method.

find the sample code,

DialogRunbase dialog = super();

Object DialogStartGrp ;

DialogStartGrp = dialog.mainFormGroup();
dialog.addTabPage(“DialogStartGrp”);
dialog.addGroup(“DialogStartGrp”);
dialog.mainFormGroup(DialogStartGrp);
dialog=null;