This article demonstrates how to show in the context menu whenever the user select a cell in a grid open to him another form related to the first one through a relation between them.
after creating the form expand to DataSource >> then got to the selected field >> Override the methods >>
JumpRef as the code below
Trucks_CT_SETUP : the form that will open
Trucks_CT : the table name
TruckId : the field name
////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void jumpRef()
{
Args args;
FormRun formRun;
;
args = new Args(formStr(Trucks_CT_SETUP));
args.caller(element);
args.lookupField(fieldNum(Trucks_CT, TruckId));
args.lookupValue(Drivers_CT.TruckId);
formRun = ClassFactory::formRunClassOnClient(args);
formRun.init();
formRun.run();
formRun.wait();
}
after creating the form expand to DataSource >> then got to the selected field >> Override the methods >>
JumpRef as the code below
Trucks_CT_SETUP : the form that will open
Trucks_CT : the table name
TruckId : the field name
////////////////////////////////////////////////////////////////////////////////////////////////////////////
public void jumpRef()
{
Args args;
FormRun formRun;
;
args = new Args(formStr(Trucks_CT_SETUP));
args.caller(element);
args.lookupField(fieldNum(Trucks_CT, TruckId));
args.lookupValue(Drivers_CT.TruckId);
formRun = ClassFactory::formRunClassOnClient(args);
formRun.init();
formRun.run();
formRun.wait();
}
No comments:
Post a Comment