Here we want to create new form using x++ code in job,
Here all of the Form classes(Form,FormRun.......) are system Documentation classes.These are predefined classes.
{
Args args;
Form form;
FormRun formRun;
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(formBuildDatasource.id(),
fieldNum(PurchTable, PurchId));
formString.label("PurchId");
formString = formBuildGridControl.addControl(FormControlType::Real, "Korcomptenz");
formString.label("Korcomptenz");
args = new Args();
args.object(form);
formRun = classFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
}
The output Screen is,
No comments:
Post a Comment