Using API fnd_profile.save to update profile from backend

Source: Internet
Author: User

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'

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.