This is mine simple way:
Main forms data source create method:
{
Args args;
FormRun formCreate;
;
args = new Args();
args.name(formstr(B_ExpressServiceNew));
args.caller(element);
formCreate = classfactory.formRunClass(args);
formCreate.init();
formCreate.run();
formCreate.wait();
}
B_ExpressServiceNew, is my new record forms name.
This part should write at new record forms new record method:
if (element.args() && element.args().caller() && element.args().caller().name() == formstr(B_ExpressService))
{
mainForm = element.args().caller();
mainForm.SetRecord(oTable);
}
B_ExpressService is my main form, oTable is my new record.
Setrecord method at main form for locate new record:
void SetRecord(SMAServiceOrderTable _order)
{
;
SMAServiceOrderTable.reread();
SMAServiceOrderTable.data(_order);
SMAServiceOrderTable_DS.setCurrent();
}
Hiç yorum yok:
Yorum Gönder