check global variable [message #442614] |
Tue, 09 February 2010 07:34 |
allianz2010
Messages: 101 Registered: October 2009 Location: Pakistan
|
Senior Member |
|
|
can we check global variable's value is create or not and if created then how can i get it value...
|
|
|
|
|
Re: check global variable [message #442678 is a reply to message #442676] |
Tue, 09 February 2010 23:11 |
tamzidulamin
Messages: 132 Registered: October 2009 Location: Dhaka
|
Senior Member |
|
|
You can check the value of GLOBAL variable by the following way.
If :global.variable_name is not null then
If :global.variable_name = '' then --Your desired value.
Your required action here....
End If;
End If;
Regards
Tamzidul Amin
|
|
|
|
Re: check global variable [message #442683 is a reply to message #442682] |
Tue, 09 February 2010 23:33 |
tamzidulamin
Messages: 132 Registered: October 2009 Location: Dhaka
|
Senior Member |
|
|
Dear,
Your must have declare all GLOBAL varibales in NEW-FORM-INSTANCE
in to your LOGIN form.Otherwise when u assign some value into your Global variable the form raise
Quote:FRM-40815: Variable GLOBAL.%s does not exist. .
Regards,
Tamzidul Amin.
|
|
|
Re: check global variable [message #442685 is a reply to message #442683] |
Wed, 10 February 2010 00:00 |
allianz2010
Messages: 101 Registered: October 2009 Location: Pakistan
|
Senior Member |
|
|
thanks your reply sir...
I Write this code in PRE-FORMS
IF :GLOBAL.USER_NAME IS NULL THEN
:PARAMETER.USER_RIGHTS := 'N';
ELSE
CHK_RIGHT('OPEN_FRM'); --this is procedure check user rights
IF :PARAMETER.USER_RIGHTS='N' THEN
SET_ALERT_PROPERTY('COMMON_ALRT', ALERT_MESSAGE_TEXT, 'You have no Rights to Open this Form...!');
ALRT := SHOW_ALERT('COMMON_ALRT');
ELSE
--MDI_ICO := WIN_API_UTILITY.GET_ACTIVE_WINDOW;
--WIN_API_SESSION.CHANGE_MDI_ICON(MDI_ICO, '.\Icons\awc3.ico', 0);
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_STATE,MAXIMIZE);
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,PRG_TITLE);
SET_WINDOW_PROPERTY('WINDOW1',TITLE,:PARAMETER.FRM_NAME);
A_CNTR_FRM('WINDOW1');
END IF;
END IF;
and write in when_new_form_instance this code...
IF :PARAMETER.USER_RIGHTS = 'N' THEN
EXIT_FORM(NO_VALIDATE);
end if;
if i use this above code then, when any body want to open any form without log-in form then just raise this error and close the forms...
FRM-40815: Variable GLOBAL.%s does not exist.
Your must have declare all GLOBAL varibales in NEW-FORM-INSTANCE
in to your LOGIN form.Otherwise when u assign some value into your Global variable the form raise
I Think you say that i write code like this...
PRE-FORM TRIGGER
CHK_RIGHT('OPEN_FRM'); --this is procedure check user rights
IF :PARAMETER.USER_RIGHTS='N' THEN
SET_ALERT_PROPERTY('COMMON_ALRT', ALERT_MESSAGE_TEXT, 'You have no Rights to Open this Form...!');
ALRT := SHOW_ALERT('COMMON_ALRT');
ELSE
--MDI_ICO := WIN_API_UTILITY.GET_ACTIVE_WINDOW;
--WIN_API_SESSION.CHANGE_MDI_ICON(MDI_ICO, '.\Icons\awc3.ico', 0);
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,WINDOW_STATE,MAXIMIZE);
SET_WINDOW_PROPERTY(FORMS_MDI_WINDOW,TITLE,PRG_TITLE);
SET_WINDOW_PROPERTY('WINDOW1',TITLE,:PARAMETER.FRM_NAME);
A_CNTR_FRM('WINDOW1');
when_new_form_instance
[code]
IF :GLOBAL.USER_NAME = IS NULL THEN
EXIT_FORM(NO_VALIDATE);
end if;
[/code]
if i use global variable in when_new_form_instance
than first form open and then again this error comes...
FRM-40815: Variable GLOBAL.%s does not exist.
i hope you understand my problem...
|
|
|
|
|
|
|
Re: check global variable [message #442864 is a reply to message #442839] |
Thu, 11 February 2010 00:53 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I'm afraid that I was misunderstood.
Obviously, you did find documentation about DEFAULT_VALUE; that's fine.
Then you posted this:DEFAULT_VALUE('***','GLOBAL.USER_NAEM'); and said that you still got the error.
Then I asked WHERE DID YOU PUT IT and what raises the error, and - instead of a reply as "into the WHEN-NEW-FORM-INSTANCE trigger, while WHEN-VALIDATE-ITEM raises an error" or wherever / whatever it is, there's a suggestion for me.
OK, fine, thank you, but - you still have a problem, and all I can tell (as you don't answer questions) is to repeat: you first have to declare a variable, then use it.
|
|
|
|
|
|
|
|
|
Re: check global variable [message #443210 is a reply to message #443009] |
Sat, 13 February 2010 12:35 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
LF: This is the first part of @allianz2010's last message; the original message has been split from this topic as it addresses a completely different problem (icons in Forms).
allianz2010
Thanks for your reply... and sorry for my late reply...
because yesterday i leave the office....
my problem is now solved....
|
|
|