Creating Form through X++

static void CreateFormThroughCode(Args _args)

Form                   form;
FormRun             formRun;
Args                    args;
FormBuildDesign         formBuildDesign;
FormBuildControl        formBuildControl;
FormBuildTabControl     formBuildTabControl;
FormBuildTabPageControl formBuildTabPageControl;
FormBuildGridControl    formBuildGridControl;
FormBuildDatasource     formBuildDatasource;
FormBuildStringControl  formString; ;

form = new Form();
formBuildDatasource = form.addDataSource(tableStr(PurchTable));
formBuildDesign = form.addDesign(“design”);
formBuildTabControl = formBuildDesign.addControl(FormControlType::Tab, “Tab”);
formBuildTabPageControl = formBuildTabControl.addControl(FormControlType::TabPage, “TabPage”); formBuildGridControl = formBuildTabPageControl.addControl(FormControlType::Grid, “Grid”);

formString = formBuildGridControl.addDataField(, fieldNum(PurchTable, PurchId));
formString = formBuildGridControl.addControl(FormControlType::Real,”Anil”); formString.label(“Ali”);

args    = new Args(); args.object(form);
formRun = classFactory.formRunClass(args);



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: