Syntax
Fnd_profile.save (<profile_option_name>,
<Profile_option_value>,
<Level site/appl/RESP/user>,
<Level_value>,
<Level_value_app_id> );
Example
Set serveroutput on size 1000000
Declare
Rochelle user_id number;
Rochelle resp_id number;
Rochelle resp_app_id number;
Rochelle success Boolean;
Begin
Rochelle user_id: = 1068; -- *** use your user ID to replace, 1068 is MFG ***
--
-- This will set value of profile option 'inv _ debug_level 'at site level to 11
--
Rochelle success: = fnd_profile.save
(X_name => 'inv _ debug_level'
, X_value => 11
, X_level_name => 'SITE'
, X_level_value => null
, X_level_value_app_id => null
);
If l_success
Then
Dbms_output.put_line ('profile updated successfully at site level ');
Else
Dbms_output.put_line ('profile update failed at site level. Error: '| sqlerrm );
End if;
--
-- This will set value of profile option 'inv _ debug_level 'At resp level to 11
--
Select responsibility_id
, Application_id
Into l_resp_id
, L_resp_app_id
From fnd_responsibility
Where responsibility_key = 'ventory ';
Rochelle success: = fnd_profile.save
(X_name => 'inv _ debug_level'
, X_value => 11
, X_level_name => 'resp'
, X_level_value => l_resp_id -- responsibility_id
, X_level_value_app_id => l_resp_app_id -- 401
);
If l_success
Then
Dbms_output.put_line ('profile updated successfully at responsiblity level ');
Else
Dbms_output.put_line ('profile update failed at site level. Error: '| sqlerrm );
End if;
--
-- This will set value of profile option 'inv _ debug_level 'at user level to 11
--
Rochelle success: = fnd_profile.save
(X_name => 'inv _ debug_level'
, X_value => 11
, X_level_name => 'user'
, X_level_value => l_user_id
);
If l_success
Then
Dbms_output.put_line ('profile updated successfully at user level ');
Else
Dbms_output.put_line ('profile update failed at site level. Error: '| sqlerrm );
End if;
-- Commit is needed because this function will not commit
Commit;
End;
/
Useful queries
Select B. user_profile_option_name, .*
From fnd_profile_options A, fnd_profile_options_tl B
Where a. profile_option_name = B. profile_option_name
And a. profile_option_name like 'inv _ debug %'
And B. Language = 'us ';
Select C. user_profile_option_name, B. profile_option_name, .*
From fnd_profile_option_values A, fnd_profile_options B, fnd_profile_options_tl C
Where B. profile_option_name = C. profile_option_name
And a. profile_option_id = B. profile_option_id
And a. application_id = B. application_id
And C. Language = 'us'
And upper (C. user_profile_option_name) Like upper ('inv % debug % trace % ');
10001: 'SITE ',
10002: 'application ',
10003: 'responsibility ',
10004: 'user ',
10005: 'server'