Search This Blog

Friday, July 19, 2013

Read-Only responsibility in Oracle Applications

Read-Only responsibility in Oracle Applications

1.      Identify the menu that is attached to the Responsibility.
2.      Identify the form functions that are attached to this menu.
3.      Now create a new form function exactly similar to the standard one but with the option  QUERY_ONLY="YES" in the location.
a.      Sysadmin > Application > Function > Form > Parameter.
4.      This makes the function read only.
5.      Now create a new menu with these read-only functions and attach the menu to a new responsibility which is assigned to users who need to have read-only privileges.
What if the user has 50 responsibilities? It consumes a lot of time in creating the functions, menus and finally adding relevant profiles to the responsibility. There is another simpler way to make all the responsibilities of a user as read-only.

How to make all the responsibilities of a User Read-Only in Oracle Applications

Use the following piece of code in Procedure Event for the Event Name WHEN-NEW-FORM-INSTANCE in Custom.pll. With out much effort you can simply make all the responsibilities of a user read-only. But you need to hardcode the user name, which is a setback. Custom.pll is located in $AU_TOP/resource.


BEGIN
IF event_name = ‘WHEN-NEW-FORM-INSTANCE’ THEN
IF FND_PROFILE.VALUE(’USER_NAME’)= ’XXXXXXX’ THEN /*ENTER THE USERNAME THAT IS USED BY AUDITORS*/
BEGIN
COPY(’Entering app_form.query_only_mode.’,'global.frd_debug’);
COPY(’YES’, ‘PARAMETER.QUERY_ONLY’);
APP_MENU2.SET_PROP(’FILE.SAVE’, ENABLED,PROPERTY_OFF);
APP_MENU2.SET_PROP(’FILE.ACCEPT’, ENABLED,PROPERTY_OFF);
formname := NAME_IN(’system.current_form’);
blockname := GET_FORM_PROPERY(formname, FIRST_BLOCK);
WHILE (blockname is not null) LOOP
IF (GET_BLOCK_PROPERTY(blockname, BASE_TABLE) is not NULL) THEN
SET_BLOCK_PROPERTY(blockname, INSERT_ALLOWED, PROPERTY_FALSE);
SET_BLOCK_PROPERTY(blockname, UPDATE_ALLOWED, PROPERTY_FALSE);
SET_BLOCK_PROPERTY(blockname, DELETE_ALLOWED, PROPERTY_FALSE);
END IF;
blockname := GET_BLOCK_PROPERTY(blockname, NEXTBLOCK);
END LOOP;
END query_only_mode;
END IF;
END IF;
END;

No comments:

Post a Comment