Read Only Responsibility using Custom.pll in Oracle Applications

Read Only Responsibility using Custom.pll in Oracle Applications, www.askhareesh.com
Add the following code in Procedure Event for the Event Name WHEN-NEW-FORM-INSTANCE in Custom.pll. to make the responsibility of a user read-only. All you need to give/set the responsibility.


BEGIN
   IF EVENT_NAME = 'WHEN-NEW-FORM-INSTANCE'
   THEN
      --Responsibility ID
      IF FND_PROFILE.VALUE ('RESP_ID') = 12345
      THEN
         BEGIN
            COPY ('Entering app_form.query_only_mode.', 'global.frd_debug');
            --QUERY_ONLY="YES"
            COPY ('YES', 'PARAMETER.QUERY_ONLY');
            --Disabling the save and accept standard menus in form
            APP_MENU2.SET_PROP ('FILE.SAVE', ENABLED, PROPERTY_OFF);
            APP_MENU2.SET_PROP ('FILE.ACCEPT', ENABLED, PROPERTY_OFF);
            -- Get the current form
            FORM_NAME := NAME_IN ('system.current_form');
            --Get the current block
            BLOCK_NAME := GET_FORM_PROPERTY (FORM_NAME, FIRST_BLOCK);

            --loop to get all datablocks in current form
            WHILE (BLOCK_NAME IS NOT NULL)
            LOOP
               IF (GET_BLOCK_PROPERTY (BLOCK_NAME, BASE_TABLE) IS NOT NULL)
               THEN
                  --Set insert, update and delete not allowed
                  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;

Also read : Oracle recommendation method to make read only responsibility
Also read : How to compile custom.pll in Oracle Apps R12

*/