Oracle Apps Notes

A collection of my random notes, primarily on Oracle Apps

Make all responsibilities read-only for a user

Metalink Note#363298.1 provides instructions on how to make all responsibilities read-only for a user through CUSTOM.pll. The note, however, is not detailed enough and some missing information and typographical errors make things even more confusing. This post will provide step-by-step instructions on how to achieve the functionality. I have tested it on a 11.5.10 instance. As always, ensure that you have backed-up the original CUSTOM.pll before you make any changes.

1. Download the CUSTOM.pll from the server to your local machine. Ensure that all the libraries under $AU_TOP/resource/ are present in the proper path on your local machine.  Copying all files from $AU_TOP/resources/ to ORACLE_HOME/TOOLS/OPEN60/PLSQLLIB (where ORACLE_HOME is the Forms6i home directory on your local machine) is an easy way to make sure that all required libraries are present.

2. Open CUSTOM.pll in Form Builder. You will notice that the only attached library is FNDSQF.

3. You need to attach the APPCORE2 library so that the code in the CUSTOM.pll works. To do that, first click on Attached Libraries and then click on the green plus icon on the left to open the Attach Library window. Browse for APPCORE2.pll on your local machine and attach it to CUSTOM.pll. Once that is done, APPCORE2.dll will be displayed in the list of attached libraries.

4. In procedure event of the CUSTOM.pll body, comment out the following three lines

--begin
-- null;
--end event;

and add the following code

 formname varchar2(30);
 blockname varchar2(30);

 begin
 IF event_name = 'WHEN-NEW-FORM-INSTANCE' THEN
 IF FND_PROFILE.VALUE('USERNAME')='EBUSINESS' 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);
 formname := NAME_IN('system.current_form');
 blockname := GET_FORM_PROPERTY(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;
 END IF;
 END IF;
 end event;

Note that I have made all responsibilities read-only for the EBUSINESS user, you can change it as per your requirement. The body of my CUSTOM.pll is attached here.

Body of CUSTOM.pll

5. Save the CUSTOM.pll and transfer it back to the server. Compile it using the following command to complete your work.

f60gen module=CUSTOM.pll userid=apps/***** output_file=CUSTOM.plx module_type=LIBRARY

Forms for all responsibilities will now become read-only for the EBUSINESS user

While for other users, they will behave normally

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: