static void createForm(Args _args)
{
Args args;
Form form;
FormRun formRun;
FormBuildDesign formBuildDesign;
FormBuildDataSource formBuildDataSource;
FormBuildDataSource formBuildDataSource2;
FormBuildGridControl formBuildGridControl;
FormDataSource formDataSource;
DictTable dictTable;
DictTable dictTable2;
int idx;
;
// Create the form header.
form = new Form();
// Add data sources to the form.
dictTable = new DictTable(tablenum(CustTable));
formBuildDataSource = form.addDataSource(dictTable.name());
formBuildDataSource.table(dictTable.id());
dictTable2 = new DictTable(78);
formBuildDataSource2 = form.addDataSource(dictTable2.name());
formBuildDataSource2.table(dictTable2.id());
// Create the form design.
formBuildDesign = form.addDesign("Design");
// Add a grid control.
formBuildGridControl =
formBuildDesign.addControl(FormControlType::Grid, "Table Grid");
formBuildGridControl.dataSource(dictTable.name());
// Add a data field to the grid control.
formBuildGridControl.addDataField(formBuildDataSource.id(),
dictTable.fieldName2Id("AccountNum"));
args = new Args();
args.object(form);
// Create the run-time form.
formRun = new FormRun(Args);
formRun.run();
formRun.detach();
// Return an object for the first data source,
// and then display a query form.
formdatasource = formRun.dataSource(1);
formdatasource.prompt();
}
No comments:
Post a Comment