Thursday 15 May 2014

How to make responsibilities as read only in oracle apps

There are two ways to make responsibility as ready only:

1. Form Function Method
2. custom.pll

Form Function Method
1. Identify the menu attached to the responsibility that you wish to make it a Read only Responsibility
2. Identify the form functions that are attached to this menu.
3. Define a new form function exactly similar to the existing one but with the option QUERY_ONLY="YES" at the location "Application"-->"function"-->"Form"-->"Parameter".
4. The Parameter sets the function in Query Only mode.
5. Final step is to create a custom menu with the new read only functions created and attach the menu to the  new responsibility.


CUSTOM.pll 
Use the following piece of code in Procedure Event for the Event Name WHEN-NEW-FORM-INSTANCE in Custom.pll. Without 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('RESP_ID')=  502502 THEN 
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); 
form_name := NAME_IN('system.current_form'); 
block_name := GET_FORM_PROPERTY(form_name, FIRST_BLOCK); 
WHILE (block_name is not null) LOOP 
IF (GET_BLOCK_PROPERTY(block_name, BASE_TABLE) is not NULL) THEN 
SET_BLOCK_PROPERTY(block_name, INSERT_ALLOWED, PROPERTY_FALSE); 
SET_BLOCK_PROPERTY(block_name, UPDATE_ALLOWED, PROPERTY_FALSE); 
SET_BLOCK_PROPERTY(block_name, DELETE_ALLOWED, PROPERTY_FALSE); 
END IF; 
block_name := GET_BLOCK_PROPERTY(block_name, NEXTBLOCK); 
END LOOP; 
END query_only_mode; 
END IF; 
END IF; 
END; 

No comments:

Post a Comment