Executing Query through parameter [message #362768] |
Thu, 04 December 2008 01:45 |
*munnabhai*
Messages: 157 Registered: March 2008 Location: Riyadh
|
Senior Member |
|
|
I have a form employee i create two parameter as below
empid and emp_name
im calling another form (civil status) from form employee. on employee block i create one button calling form and passing parameters as below
declareplist ParamList;beginplist := Create_Parameter_List('INPUT_PARAM');Add_Parameter(plist, 'empid',TEXT_PARAMETER,:employee.empid);Add_Parameter(plist, 'emp_name',TEXT_PARAMETER,:employee.emp_name);
CALL_FORM(GETPATH||'CIVIL_STATUS',no_HIDE,NO_REPLACE,NO_QUERY_ONLY,plist);DESTROY_PARAMETER_LIST(plist);
end;
on the calling form i create same parameters as in employee and put the parameter values in when new form instance trigger as below
:EMP_CIVIL_STATUS.EMPID := :PARAMETER.EMPID;
:EMP_CIVIL_STATUS.EMP_NAME := :PARAMETER.EMP_NAME;
i put one more validation trigger on form civil_status.empid when-validate-item for no duplication.
BEGIN
VALIDATE_ITEM(:EMP_CIVIL_STATUS.EMPID,'Employee ID Cannot be NULL');
SELECT EMPID INTO :EMP_CIVIL_STATUS.EMPID
FROM EMP_CIVIL_STATUS
WHERE RTRIM(EMPID)=:EMP_CIVIL_STATUS.EMPID;
ALERT_MESSAGES('Employee ID.'''||:EMP_CIVIL_STATUS.EMPID||''' Already Exist Insert another one...');
EXCEPTION
WHEN NO_DATA_FOUND THEN NULL;
END;
the scenario starts here parameters is working properly, after calling the form civil_status it should check the parameter.empid in form civil_status if the record meets with the same parameter value then execute query and stop processing other wise if record dosent meet with parameter.empid then show the alert and ask user 'Record does not exist create new?' if user say yes then put the same parameters in the empid and emp_name and rest user fill the records. if user say no then exit form without validate how can i do this anyone can help me in this plz...im stuck in this for the last two days....
Regards
|
|
|
|
|
Re: Executing Query through parameter [message #362786 is a reply to message #362768] |
Thu, 04 December 2008 02:35 |
rajy_salim
Messages: 204 Registered: January 2008 Location: Beirut - Lebanon
|
Senior Member |
|
|
YES, it's not formatted in a way anyone can read it easily.
For the second time, please read The Forum Guide, and re-post your FORMATTED code, as it might be. Use the appropriate tags to do that.
In order to have good answers for your questions, please provide a well organized, eazy-to-read post, else, no one will be able to help you.
Rajy
|
|
|
|
|
|
Re: Executing Query through parameter [message #362848 is a reply to message #362768] |
Thu, 04 December 2008 05:13 |
rajy_salim
Messages: 204 Registered: January 2008 Location: Beirut - Lebanon
|
Senior Member |
|
|
That's what I meant to say. Personally, I am not ready to search between lines . . .
A membership of about one year is pretty enough to learn the basics of posting threads.
Such OP is the only looser in this case and the only badly affected person since others are not interrested in reading his post, and do not really care if he solves his problems or not.
Rajy
|
|
|