Home » Developer & Programmer » Forms » Passing parameter from menu to a form - V.V.Urgent
Passing parameter from menu to a form - V.V.Urgent [message #84483] Sun, 21 March 2004 20:21 Go to next message
K.B.Shesha Saai
Messages: 14
Registered: February 2004
Junior Member
Hi All,

In Forms 5.0, (Windows 98) Can you please suggest me how to pass a parameter from a menu to a form.  I will tell u situation.  I have a menu in which there are different options.  In that menu, i have two options called Vendor Update and Vendor delete. If i click either of those options, i have to open a single form.  But based on the parameter like UPDATE or DELETE, i have to do some validations in the form. 

Can anyone suggest APPROPRIATE solution for this.  Its very urgent

 

Thank you

 
Re: Passing parameter from menu to a form - V.V.Urgent [message #84522 is a reply to message #84483] Fri, 26 March 2004 03:06 Go to previous message
Vamsi Mohan
Messages: 16
Registered: December 2003
Junior Member
One option is to use global variables

In Menu Item Code of Vendor Update
:global.UPD_OR_DEL := 'UPDATE';
call_form('vendor.fmx'...............);
erase('global.UPD_OR_DEL');

In Menu Item Code of Vendor delete
:global.UPD_OR_DEL := 'DELETE';
call_form('vendor.fmx'...............);
erase('global.UPD_OR_DEL');

in vendor form the action can be referred as
:global.UPD_OR_DEL to do the validations.

Second option is to use Parameters
In Menu Item Code of Vendor Update

declare
pl_id ParamList;
BEGIN

pl_id := Get_Parameter_List('action');

IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;

pl_id := Create_Parameter_List('action');

Add_Parameter(pl_id,'action',TEXT_PARAMETER,'UPDATE');

call_form('vendor.fmx',no_hide,do_replace,pl_id,no_query_only,pl_id);

DESTROY_PARAMETER_LIST(PL_ID);
END;

Second option is to use Parameters

In Menu Item Code of Vendor Delete

declare
pl_id ParamList;
BEGIN

pl_id := Get_Parameter_List('action');

IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List( pl_id );
END IF;

pl_id := Create_Parameter_List('action');

Add_Parameter(pl_id,'action',TEXT_PARAMETER,'DELETE');

call_form('vendor.fmx',no_hide,do_replace,pl_id,no_query_only,pl_id);

DESTROY_PARAMETER_LIST(PL_ID);
END;

In the form vendor a parameter should be created in the object navigator with the name "action".

the value :parameter.action can be used for validations
Previous Topic: How to give alle negative values a red bagground in a multirecord block
Next Topic: Oracle 9i backup and Recovery
Goto Forum:
  


Current Time: Wed Apr 24 15:46:10 CDT 2024