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;