Enable\Disable menu items for different users [message #87050] |
Thu, 02 December 2004 01:00 |
Jamil
Messages: 13 Registered: December 2003
|
Junior Member |
|
|
Dear friends
I have this message FRM-41067 cannot find menu item invalid ID
And I have coded this code under MENU STARUP CODE
DECLARE
VAR_MENU VARCHAR2(40);
VAR_P VARCHAR2(40);
VAR_ENABLE VARCHAR2(1);
VAR_LOC VARCHAR2(40);
BEGIN
:GLOBAL.USER_NAME := Get_Application_Property(USERNAME);
SELECT M_ENABLE,LTRIM(RTRIM(NAME)),LTRIM(RTRIM(SUB_NAME))
INTO VAR_ENABLE,VAR_MENU,VAR_P
FROM MEN_TABLE
WHERE USER_NAME=:GLOBAL.USER_NAME;
IF VAR_ENABLE = 'X' THEN
SET_MENU_ITEM_PROPERTY('VAR_MENU.VAR_P',ENABLED,PROPERTY_TRUE);
ELSE
SET_MENU_ITEM_PROPERTY('VAR_MENU.VAR_P',ENABLED,PROPERTY_FALSE);
END IF;
END;
How can I solve the above problem
And I want to use cursor for selecting the menu option from MEN_TABLE and how can I do that with example
Waiting for your valuable answer
Best Regards
Jamil
|
|
|
|
Re: Enable\Disable menu items for different users [message #87062 is a reply to message #87050] |
Thu, 02 December 2004 22:46 |
Himanshu
Messages: 457 Registered: December 2001
|
Senior Member |
|
|
Hi,
Other than what Vamsi has told you remove single quotes form the menu name & rewrite the code as follows:
IF VAR_ENABLE = 'X' THEN
SET_MENU_ITEM_PROPERTY(VAR_MENU||'.'||VAR_P,ENABLED,PROPERTY_TRUE);
ELSE
SET_MENU_ITEM_PROPERTY(VAR_MENU||'.'||VAR_P,ENABLED,PROPERTY_FALSE);
END IF;
Actually what is happening that due to single quotes the system thinks that you wnat to enable or disable a Menu item which has a name VAR_MENU.VAR_P which are actually your variables.
So just rewrite your code as explained above.
It will work.
HTH
Regards
Himanshu
|
|
|
Re: Enable\Disable menu items for different users [message #87075 is a reply to message #87050] |
Fri, 03 December 2004 19:29 |
Jamil
Messages: 13 Registered: December 2003
|
Junior Member |
|
|
Dear Himanshu
Thank you very much for your help it works fine but can you help me how to do it with the cursor option because this one only for a single record, and also my main problem with this statement
:GLOBAL.USER_NAME := Get_Application_Property(USERNAME); because I am using this code in the Menu Startup Code , so I want to get variable :GLOBAL.USER_NAME can you give me an example how to do it with the cursor and where to code this statement
:GLOBAL.USER_NAME := Get_Application_Property(USERNAME);
Waiting for your valuable answer
Best regards
Jamil
|
|
|
|
Re: Enable\Disable menu items for different users [message #623270 is a reply to message #87050] |
Sun, 07 September 2014 12:15 |
kilimanjaro
Messages: 151 Registered: May 2009 Location: Tanzania
|
Senior Member |
|
|
Hello Jamil
I will appreciate if you can give me step by step instructions of how you managed to achieve this.I have tried your code but the cursor blinks at the 'Men_table'.This table I have not created it .please if you can give me its description too.General ,I'm using oracle forms 6i and I want some users to access only some menu items .
Thank you very much.
|
|
|
|
|
|
Re: Enable\Disable menu items for different users [message #689040 is a reply to message #689038] |
Thu, 31 August 2023 00:20 |
|
mfahimaamirgmailcom
Messages: 64 Registered: May 2011 Location: pakistan
|
Member |
|
|
Thank you for your reply
Dear Sir, I followed your instructions, but the system gave me an error at the time of running
the form.FRM-10256: User is not authorized to run Form Builder Menu
the form.FRM-10256: User is not authorized to run Form Builder Menu
see my code in startup codeÂ
declare
 l_username varchar2(40);
begin
 l_username := get_application_property(username);
 SET_MENU_ITEM_PROPERTY('MANUMENUWINDOW.TEST1',ENABLED,PROPERTY_FALSE);
end;
sir see attached picture
Could you please guide me on Module Roles and how to define them
Now I'm logged in as Scott
I greatly appreciate your valuable guidance and assistance
Regard's
|
|
|