HOW TO set profile option at user level in oracle apps

About Profile Options,

Profile Options are the values to control oracle applications behavior.

Quick Case Study: Your Accounts Payable department recently purchased a printer, and you want all the reports from that department to print on that new printer. You simply change the "Printer" profile option for Oracle Payables to reflect the purchase of the new printer.

User: Option settings pertain to an individual user, identified by their application user name.

 

To update a profile option at user level, follow below:


SELECT profile_option_name
  FROM fnd_profile_options_tl
 WHERE user_profile_option_name = 'FND: Diagnostics'


All you need is the Profile Option Name 

Declare
Result Boolean;
BEGIN

   Result:= fnd_profile.SAVE ('FND_DIAGNOSTICS', 'Y', 'USER');
   IF Result
   THEN
      DBMS_OUTPUT.put_line ('Profile Updated');
   ELSE
      DBMS_OUTPUT.put_line ('Profile Not Updated');
   END IF;
   COMMIT;
END;


Query used for audit point of view i.e. when a profile is changed and by whom user:


SELECT t.user_profile_option_name,
         profile_option_value,
         v.creation_date,
         v.last_update_date,
         v.creation_date - v.last_update_date "Change Date",
         (SELECT UNIQUE user_name
            FROM apps.fnd_user
           WHERE user_id = v.created_by)
            "Created By",
         (SELECT user_name
            FROM apps.fnd_user
           WHERE user_id = v.last_updated_by)
            "Last Update By"
    FROM apps.fnd_profile_options     o,
         apps.fnd_profile_option_values v,
         apps.fnd_profile_options_tl  t
   WHERE     o.profile_option_id = v.profile_option_id
         AND o.application_id = v.application_id
         AND start_date_active <= SYSDATE
         AND NVL (end_date_active, SYSDATE) >= SYSDATE
         AND o.profile_option_name = t.profile_option_name
         AND level_id = 10001
         AND t.LANGUAGE IN (SELECT language_code
                              FROM apps.fnd_languages
                             WHERE installed_flag = 'B'
                            UNION
                            SELECT nls_language
                              FROM apps.fnd_languages
                             WHERE installed_flag = 'B')
ORDER BY user_profile_option_name;

Comments

Popular posts from this blog

HOW TO auto approve workflow WF notification procedure

HOW TO register table in oracle apps

HOW TO update an existing user in oracle apps