Monday 16 July 2012

Setting a profile option from backend - Example

Background:
Sets the value of a profile option permanently to the database, at any level.
Note: This routine will NOT actually commit the changes. The caller must commit.
returns TRUE if successful, FALSE if failure.

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

Parameters Explanation:
Profile_Option_Name : Profile name you are setting 
Profile_Option_Value : Profile value you are setting
Level                          : Level that you're setting at. It could be 'SITE', 'APPL','RESP', or 'USER' 
Level_Value               : Level value that you are setting at,
                                    e.g. user id for 'USER' level. This is not used at site level
Level_Value_App_id  : Only used for 'RESP' level. Application_Id of the responsibility.

Useful tables: 
select * from fnd_profile_options;
select * from fnd_profile_option_values;

Examples:
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'SITE');
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'APPL', 321532);
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'RESP', 321532, 345234);
FND_PROFILE.SAVE('P_NAME', 'P_VAL', 'USER', 123321);

I'll post a full working example shortly.

No comments:

Post a Comment