Opening other form while creating a record in the current form.

Hi,
Many of us may come across a requirement where a new form should open while creating a new record in the current form. So that, the dataentered in the new form may be populated into the current form after clicking “OK” button. You can Observe this functionality in New sales order creation.


create a new method in main form.
MAIN FORM:::
void research(STU_1 _STU)
{ ;
STU_1_ds.research();
STU_1_ds.findRecord(_STU);
}

just add this code to init method of the form. to control super().
public void init()
{
;
SysListPageHelper::handleInitPreSuper(element);
super();
SysListPageHelper::handleInitPostSuper(element);
}

Comment super() in create method and call the other form from the create method.
public void create(boolean _append = false)
{
Args a;
formrun fr;
;
a = new Args();
a.name(formstr("stu_Create"));
a.caller(element);
a.record(stu_1);
fr = ClassFactory.formRunClass(a);
fr.init();
fr.run();
fr.wait();
}
-------------------------------------------------------------------------------
SUB FORM :::
Write the below code in the Clicked method of OK method.
void clicked()
{
args args_1;
formrun formrun;
;
super();
STU_1.write();
element.args().caller().research(STU_1);
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s