Wednesday, November 13, 2019

Update Profile values in Oracle APPS


Script to update profile values in oracle apps

How to Change Profile Option Value Without Forms? (Doc ID 943710.1)
Profile Option Values can be changed from backend using FND_PROFILE.SAVE procedure.

Syntax:
FND_PROFILE.SAVE(<Profile_Option_Name>, <Profile_Option_Value>, <Level SITE/APPL/RESP/USER>, <Level_Value>, <Level_Value_App_id>);

We normal change only at site level/user level 

1. For site level , we just need (Profile option name and its value)
2. For user level , We need (Profile option name, value and the user id which we get from fnd_user)

FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'SITE');
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'USER', USERID);


Solution 1
----------

Declare
value Boolean;
Begin
value := fnd_profile.save('NAME','VALUE','SITE');
End; 
  /

---------------------------------------------
Solution 2 
----------


Declare
Result Boolean;
BEGIN
   Result:= fnd_profile.SAVE ('NAME','VALUE','SITE');
   IF Result
   THEN
      DBMS_OUTPUT.put_line ('Profile Updated');
   ELSE
      DBMS_OUTPUT.put_line ('Profile Not Updated');
   END IF;
   COMMIT;
END;

No comments: