MAIN STRUCTURE TO CREATE PARAMETER:
DECLARE
pl_id PARAMLIST;
pl_name VARCHAR2(10) := 'tempdata';
BEGIN
pl_id := Get_Parameter_List(pl_name);
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List(pl_id);
END IF;
pl_id := Get_Parameter_List(pl_name);
IF Id_Null(pl_id) THEN
pl_id := Create_Parameter_List(pl_name);
END IF;
Add_Parameter(pl_id,'P_REGNO',TEXT_PARAMETER,:CTRL_PATIENTINFO.PID);
Add_Parameter(pl_id,'P_ADMISSIONNO',TEXT_PARAMETER,:CTRL_PATIENTINFO.AN);
Add_Parameter(pl_id,'P_ADMISSIONNO',TEXT_PARAMETER,'');
CALL_FORM(form_path||'FORM_NAME',hide,no_replace,no_query_only,pl_id);
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
--$ -- Start : Anothr example for calling form
DECLARE
PL_ID PARAMLIST;
PL_NAME VARCHAR2 (1500) := 'CSSD_VERIFY';
V_WHERE VARCHAR2 (1500);
BEGIN
IF :CST_PRCCTL.ITEM_NO IS NOT NULL
THEN
V_WHERE :=
'EXISTS (SELECT V_TRN_NO_L1 FROM CSV_WRKLST
WHERE V_RECEIVED IS NOT NULL
AND TRN_TYPE IN (''SR'',''SC'')
AND V_ITEM_NO ='''
|| :CST_PRCCTL.ITEM_NO
|| '''
AND NVL(V_VERIFY,0) < V_TOTAL_QTY
AND V_TRN_NO_L1 = CSV_TRNTRK.TRN_NO_L1)';
ELSIF :CST_PRCCTL.GRP_NO IS NOT NULL
THEN
V_WHERE :=
'EXISTS (SELECT V_TRN_NO_L1 FROM CSV_WRKLST
WHERE V_RECEIVED IS NOT NULL
AND TRN_TYPE IN (''SR'',''SC'')
AND V_GRP_NO ='''
|| :CST_PRCCTL.GRP_NO
|| '''
AND NVL(V_VERIFY,0) < V_TOTAL_QTY
AND V_TRN_NO_L1 = CSV_TRNTRK.TRN_NO_L1)';
END IF;
PL_ID := GET_PARAMETER_LIST (PL_NAME);
IF ID_NULL (PL_ID)
THEN
PL_ID := CREATE_PARAMETER_LIST (PL_NAME);
ADD_PARAMETER (PL_ID,
'CSSD_VERIFY',
TEXT_PARAMETER,
V_WHERE);
IF ID_NULL (PL_ID)
THEN
MSGBOX ('Error creating parameter list. ');
RETURN;
END IF;
ELSE
DELETE_PARAMETER (PL_ID, 'CSSD_VERIFY');
ADD_PARAMETER (PL_ID,
'CSSD_VERIFY',
TEXT_PARAMETER,
V_WHERE);
END IF;
CALL_FORM (form_path || 'CSF_M35',
HIDE,
DO_REPLACE,
NO_QUERY_ONLY,
PL_ID);
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
--$ -- End
---another example for parameter list
PROCEDURE PRC_CALFORM(fname varchar2) IS
pl_id PARAMLIST;
pl_name VARCHAR2(10) := 'tempdata';
vST NUMBER(1);
FRM_NAME VARCHAR2(50);
v_RUN_FORM varchar2(1):= '1';
BEGIN
pl_id := Get_Parameter_List(pl_name);
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List(pl_id);
END IF;
pl_id := Get_Parameter_List(pl_name);
IF Id_Null(pl_id) THEN
pl_id := Create_Parameter_List(pl_name);
END IF;
Add_Parameter(pl_id,'RUN_FORM',TEXT_PARAMETER,v_RUN_FORM);
CALL_FORM(form_path||fname,hide,no_replace,no_query_only,pl_id);
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
-------------Example;
Note : MOBILE_NO destination form parameter name.
:PATIENT_LABTEST_PF.P_MOBILE1 source form item value. here you can also use parameter value from source form.
Note ** : use disnation form this parameter value ...because when you call distanation form that pl_id will be pass as destination form parameter value.
DECLARE
PL_ID PARAMLIST;
PL_NAME VARCHAR2(20):= 'P_MANUALAD';
BEGIN
PL_ID := GET_PARAMETER_LIST(PL_NAME);
IF ID_NULL(PL_ID) THEN
PL_ID := CREATE_PARAMETER_LIST(PL_NAME);
ADD_PARAMETER(PL_ID,'MOBILE_NO',TEXT_PARAMETER,:PATIENT_LABTEST_PF.P_MOBILE1);
IF ID_NULL(PL_ID) THEN
MSGBOX('Error creating parameter list. ');
RETURN;
END IF;
ELSE
DELETE_PARAMETER(PL_ID,'MOBILE_NO');
ADD_PARAMETER(PL_ID,'MOBILE_NO',TEXT_PARAMETER,:PATIENT_LABTEST_PF.P_MOBILE1);
END IF;
CALL_FORM(form_path||'DUMMY_FORM.fmx',HIDE,DO_REPLACE,NO_QUERY_ONLY,PL_ID);
END;
use disnation form this parameter value ...because when you call distanation form that pl_id will be pass as destination form parameter value.
Pass Parameter from One Form to another
You can easily pass parameters from one form to another form by using this code. we need to transfer values of parent form to child form for different purposes for example for Login name ect….
1- Make one parent form in oracle forms builder
2- Write this code behind the button of parent form that will transfer parameters to child form.
- Child form Name and location : D:\SUB_CAT_SIZES.FMX
- Child form parameter name: P_SUB_CAT_ID (Destination parameter)
- Parent form parameter name: :SUB_CAT_ID (Source parameter)
————————————————-
DECLARE
temp_id paramlist;
RPT_NAME VARCHAR2(30);
BEGIN
temp_id paramlist;
RPT_NAME VARCHAR2(30);
BEGIN
temp_id := CREATE_PARAMETER_LIST(‘V_A’);
ADD_PARAMETER(temp_id,’P_SUB_CAT_ID’,text_parameter,:SUB_CAT_ID);
CALL_FORM(‘D:\SUB_CAT_SIZES.FMX’,NO_HIDE,DO_REPLACE,NO_QUERY_ONLY,TEMP_ID);
destroy_parameter_list(temp_id);
END;
———————————————
ADD_PARAMETER(temp_id,’P_SUB_CAT_ID’,text_parameter,:SUB_CAT_ID);
CALL_FORM(‘D:\SUB_CAT_SIZES.FMX’,NO_HIDE,DO_REPLACE,NO_QUERY_ONLY,TEMP_ID);
destroy_parameter_list(temp_id);
END;
———————————————
3- when you will press button then parameter data will transfer into child form and also call child form.
* If you like this article then please leave comments on it……. đ
* If you like this article then please leave comments on it……. đ
----------------------------
DECLARE
pl_id PARAMLIST;
pl_name VARCHAR2(10) := 'tempdata';
BEGIN
pl_id := Get_Parameter_List(pl_name);
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List(pl_id);
END IF;
pl_id := Get_Parameter_List(pl_name);
IF Id_Null(pl_id) THEN
pl_id := Create_Parameter_List(pl_name);
END IF;
Add_Parameter(pl_id,'P_REGNO',TEXT_PARAMETER,:CTRL_PATIENTINFO.PID);
Add_Parameter(pl_id,'P_ADMISSIONNO',TEXT_PARAMETER,:CTRL_PATIENTINFO.AN);
Add_Parameter(pl_id,'P_ADMISSIONNO',TEXT_PARAMETER,'');
CALL_FORM(form_path||'FORM_NAME',hide,no_replace,no_query_only,pl_id);
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
--$ -- Start : Anothr example for calling form
DECLARE
PL_ID PARAMLIST;
PL_NAME VARCHAR2 (1500) := 'CSSD_VERIFY';
V_WHERE VARCHAR2 (1500);
BEGIN
IF :CST_PRCCTL.ITEM_NO IS NOT NULL
THEN
V_WHERE :=
'EXISTS (SELECT V_TRN_NO_L1 FROM CSV_WRKLST
WHERE V_RECEIVED IS NOT NULL
AND TRN_TYPE IN (''SR'',''SC'')
AND V_ITEM_NO ='''
|| :CST_PRCCTL.ITEM_NO
|| '''
AND NVL(V_VERIFY,0) < V_TOTAL_QTY
AND V_TRN_NO_L1 = CSV_TRNTRK.TRN_NO_L1)';
ELSIF :CST_PRCCTL.GRP_NO IS NOT NULL
THEN
V_WHERE :=
'EXISTS (SELECT V_TRN_NO_L1 FROM CSV_WRKLST
WHERE V_RECEIVED IS NOT NULL
AND TRN_TYPE IN (''SR'',''SC'')
AND V_GRP_NO ='''
|| :CST_PRCCTL.GRP_NO
|| '''
AND NVL(V_VERIFY,0) < V_TOTAL_QTY
AND V_TRN_NO_L1 = CSV_TRNTRK.TRN_NO_L1)';
END IF;
PL_ID := GET_PARAMETER_LIST (PL_NAME);
IF ID_NULL (PL_ID)
THEN
PL_ID := CREATE_PARAMETER_LIST (PL_NAME);
ADD_PARAMETER (PL_ID,
'CSSD_VERIFY',
TEXT_PARAMETER,
V_WHERE);
IF ID_NULL (PL_ID)
THEN
MSGBOX ('Error creating parameter list. ');
RETURN;
END IF;
ELSE
DELETE_PARAMETER (PL_ID, 'CSSD_VERIFY');
ADD_PARAMETER (PL_ID,
'CSSD_VERIFY',
TEXT_PARAMETER,
V_WHERE);
END IF;
CALL_FORM (form_path || 'CSF_M35',
HIDE,
DO_REPLACE,
NO_QUERY_ONLY,
PL_ID);
EXCEPTION
WHEN OTHERS
THEN
NULL;
END;
--$ -- End
---another example for parameter list
PROCEDURE PRC_CALFORM(fname varchar2) IS
pl_id PARAMLIST;
pl_name VARCHAR2(10) := 'tempdata';
vST NUMBER(1);
FRM_NAME VARCHAR2(50);
v_RUN_FORM varchar2(1):= '1';
BEGIN
pl_id := Get_Parameter_List(pl_name);
IF NOT Id_Null(pl_id) THEN
Destroy_Parameter_List(pl_id);
END IF;
pl_id := Get_Parameter_List(pl_name);
IF Id_Null(pl_id) THEN
pl_id := Create_Parameter_List(pl_name);
END IF;
Add_Parameter(pl_id,'RUN_FORM',TEXT_PARAMETER,v_RUN_FORM);
CALL_FORM(form_path||fname,hide,no_replace,no_query_only,pl_id);
EXCEPTION
WHEN OTHERS THEN
NULL;
END;
-------------Example;
Note : MOBILE_NO destination form parameter name.
:PATIENT_LABTEST_PF.P_MOBILE1 source form item value. here you can also use parameter value from source form.
Note ** : use disnation form this parameter value ...because when you call distanation form that pl_id will be pass as destination form parameter value.
DECLARE
PL_ID PARAMLIST;
PL_NAME VARCHAR2(20):= 'P_MANUALAD';
BEGIN
PL_ID := GET_PARAMETER_LIST(PL_NAME);
IF ID_NULL(PL_ID) THEN
PL_ID := CREATE_PARAMETER_LIST(PL_NAME);
ADD_PARAMETER(PL_ID,'MOBILE_NO',TEXT_PARAMETER,:PATIENT_LABTEST_PF.P_MOBILE1);
IF ID_NULL(PL_ID) THEN
MSGBOX('Error creating parameter list. ');
RETURN;
END IF;
ELSE
DELETE_PARAMETER(PL_ID,'MOBILE_NO');
ADD_PARAMETER(PL_ID,'MOBILE_NO',TEXT_PARAMETER,:PATIENT_LABTEST_PF.P_MOBILE1);
END IF;
CALL_FORM(form_path||'DUMMY_FORM.fmx',HIDE,DO_REPLACE,NO_QUERY_ONLY,PL_ID);
END;
use disnation form this parameter value ...because when you call distanation form that pl_id will be pass as destination form parameter value.
0 comments:
Post a Comment