Tuesday, September 25, 2012

Custom Code to Read only for all resposibilities and able to sumbit Concurrent srequests

----(Added the Custom Code to read only the Responsiblity )-----------
    formname    VARCHAR2 (30);
   blockname   VARCHAR2 (30);
BEGIN
   IF event_name = 'WHEN-NEW-FORM-INSTANCE'
   THEN

      IF fnd_profile.VALUE ('USER_NAME') = 'XXXX'
      THEN
(CURRENT_FORM)||'..FMB NAME..'||GET_APPLICATION_PROPERTY (CURRENT_FORM_NAME));

         IF GET_APPLICATION_PROPERTY (CURRENT_FORM_NAME) NOT IN ( 'FNDRSRUN')
         THEN
('USER_NAME'));

            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 IF;
END event;
----(End Added the Custom Code to read only the Responsiblity )-----------

No comments:

Post a Comment