Hi,
Like standard Sales order form, when we click on Create new Sales order button, a header form is opened.
Then after entering values in this form and clicking Ok, another form opens with grid containing Sales order lines but the header has the newly created sales order's information.
I have developed two similar custom forms but when I click on ok button of Header form, the Details form is pointing to a different record.
Please suggest what I missed.
I wrote this code in clicked method of OK button:
FormRun formRun;
Args args = new Args();
args = element.args();
args.name(formStr(DetailsForm));
select headerTable where headerTable.RecId = HeaderTable_ds.object(fieldnum(HeaderTable, RecId)).getValue();
args.record(headerTable);
formRun = ClassFactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.detach();