Home » Developer & Programmer » Forms » Global Variable (Windows XP DB 9i - forms 6i)
Global Variable [message #360719] Sun, 23 November 2008 06:33 Go to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
Hi guyz,

I have two forms FORM A and FORM B

i m calling form B from form A through when button press trigger along with the below code

open_form('xxx',no_hide,no_replace);
and taking some global variables also
:empid
:empname

while opening the other form i put below coding first they check the global variable and if same record found with global empid then execute query else show alert as below i dont no where im wrong in this can some one explain me please

declare 
al_id	alert;
al_button number;

if
	:system.cursor_value = :emp_civil_status.empid then
	EXECUTE_QUERY;
else
	al_button := show_alert(al_id);
	al_id := find_alert('my_alert');
	IF al_button = ALERT_BUTTON1 THEN
		:EMPID	:=:GLOBAL.EMPID;
                :EMP_NAME :=:GLOBAL.EMP_NAME;
commit_form;
	IF al_button = ALERT_BUTTON2 THEN 
		clear_form;
		exit_form;
	end if;
	end if;
end if;
end;


Regards

Re: Global Variable [message #360721 is a reply to message #360719] Sun, 23 November 2008 07:22 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
You are member of this Forum for quite a while now. When will you learn to use punctuation? This "sentence"
Quote:
while opening the other form i put below coding first they check the global variable and if same record found with global empid then execute query else show alert as below i dont no where im wrong in this can some one explain me please
is consisted of at least three sentences. Why do you expect anyone to spend time trying to understand what you meant to say? I believe that you should pay more attention to this aspect of your posts, because - if I don't understand you, I won't answer. Simple as that.

Also, I've seen that one of fellow moderators modified your post. I *suppose* (can't tell for sure) that he/she applied the [code] tags. However, they do not do the formatting - it is you who should properly format the code and do everything needed in order to preserve formatting.

If you don't know how to do that, read the OraFAQ Forum Guide once again, visit our Test forum and test your posting skills.

Quote:
first they check the global variable
Where, exactly? Global variables are preceded by a colon (:) sign, and this code certainly doesn't check any global variable "first".

Quote:
if same record found with global empid
The "same record"? Where? In a form? After it is being called, it is empty (so there are no records which could be "the same").

What is "my_alert" supposed to do? It probably has two buttons, but - what do they do? I'm really not ready to reverse engineer your code.
Re: Global Variable [message #360780 is a reply to message #360719] Mon, 24 November 2008 00:42 Go to previous messageGo to next message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
sorry little i know my english is not good like yours.

let me explain you my scenario

i have two table employee and emp_civil_status in this two table empid,emp_name are the common field.

i have two forms employee and Emp_civil_status and have data in employee

i placed one push button on form employee from this im calling another form whic is emp_civil_status and i declare some global varaible in form employee as below
:GLOBAL.EMPID:=:EMPLOYEE.EMPID;
:GLOBAL.EMP_NAME:=:EMPLOYEE.EMP_NAME;

i put this variable in emp_civil_status form (WHEN-NEW-FORM-INSTANCE) trigger, as shown below
:EMPID:=:GLOBAL.EMPID;
:EMP_NAME:=:GLOBAL.EMP_NAME;

after calling the form emp_civil_status im checking the :global.empid with :system.cursor_value=emp_civil_status.empid and executing query, if query meet with global.empid and emp_civil_staut.empid then show the records, if current records cannot meet the cursor_value then show the alert whic is 'my_alert 'Record does not exist..create new?...if user click YES they put the same variable in empid and empname and user continue insert the data in other fields in the form emp_civil_status if user click NO exit then form no_validate

hope you got my point.

Regards
Re: Global Variable [message #360860 is a reply to message #360780] Mon, 24 November 2008 02:54 Go to previous messageGo to next message
Littlefoot
Messages: 20896
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Perhaps you could try to do the following:
-- PRE-QUERY block level trigger:
EMPID := :GLOBAL.EMPID;
:EMP_NAME := :GLOBAL.EMP_NAME;

-- WHEN-NEW-FORM-INSTANCE trigger:
EXECUTE_QUERY;


If query returns no records, suggest inserting instead.

By the way,
Quote:
i know my english is not good
has absolutely nothing to do with punctuation. I don't know your language; how to do mark end of a sentence? Croatian standards are quite similar to English ones - we put a full-stop sign (.), such as in this example:
This is the first sentence. Here is another one.
                          ^                    ^
                          |                    |
                 these signs mark the end of a sentence

I've found this: الرياض on Wikipedia (as they said, it is supposed to mean "Riyadh"). These letters are completely different from anything I'm capable of reading, so ... perhaps you really don't use full stops, question marks etc.

However, while on OraFAQ Forum, I guess we should do our best to make other people understand what we'd like to say.
Re: Global Variable [message #361372 is a reply to message #360860] Wed, 26 November 2008 02:26 Go to previous message
*munnabhai*
Messages: 157
Registered: March 2008
Location: Riyadh
Senior Member
I tired this dear but not working anyhow i pass the parameters and solved the below issue thanks little for your kind support Razz
Previous Topic: for .. in .. clause
Next Topic: How to make this Hierarchical Tree?
Goto Forum:
  


Current Time: Tue Dec 06 02:50:21 CST 2016

Total time taken to generate the page: 0.07191 seconds