16 November 2010

caller - calling form with button click and caller only for a form only

---
Display->formB-Properties->RunOn: Calledform// this allow for formA.
---
Form A->button clicked()
--
void clicked()
{
Args _args;
FormRun _formRun;
EmplId _emplid;
;

super();

_emplid = EmplTable.EmplId;
_args = new Args();
_args.name(formstr(FormB));
_args.caller(this); //this refer current object form
_args.parm(_emplid);
_args.record(EmplTable);

_formRun = ClassFactory.formRunClass(_args);
_formRun.init();
_formRun.run();
_formRun.wait();

}
--
FormB->DS->init()
--
public void init()
{

EmplId _emplId;
Query query;
QueryBuildRange querybuildrangeproj;

;

super();

Switch(element.args().dataset())

{
case tablenum(EmplTable):
_emplId = element.args().parm();

query = new Query();
querybuildrangeproj = query.addDataSource(tablenum(EmplTable)).addRange(fieldnum(EmplTable, EmplId));
querybuildrangeproj.value(_emplId);// adding range value from form A
EmplTable_ds.query(query);
break;
}

}
--
Display->formB-Properties->RunOn: Calledform// this allow for formA.
----

No comments:

Post a Comment

Give me the commetns and solutions

Ledger Voucher creation Framework and x++ code to create ledger voucher

 Please click her for MS reference file Below is the out of the box example reference and code. SalesInvoiceJournalPostSubBill_Extension->...