Showing posts with label Profile Option. Show all posts
Showing posts with label Profile Option. Show all posts

Thursday, September 27, 2018

Oracle SQL to get Profile Option Values at Responsibility level


SELECT frv.responsibility_name,
  fpo.profile_option_name,
  fpot.user_profile_option_name,
  fpov.profile_option_value
FROM fnd_profile_options_tl fpot,
  fnd_profile_options fpo,
  fnd_profile_option_values fpov,
  FND_RESPONSIBILITY_VL frv
WHERE fpot.profile_option_name = fpo.profile_option_name
AND fpo.profile_option_id      = fpov.profile_option_id
AND fpov.level_id              = '10003'
AND fpov.level_value           = frv.responsibility_id
--AND frv.responsibility_name    = 'General Ledger Super User'
order by frv.responsibility_name;

Wednesday, September 26, 2018

API to Update Profile Value - SSO to Local


DECLARE
L_SUCCESS BOOLEAN;
CURSOR uid is
SELECT user_name,user_id from fnd_user where user_name in
(select user_name from apps.fnd_user where email_address in
(select email_address from apps.per_all_people_f where 1=1 and employee_number in ('215677
)));
BEGIN
DBMS_OUTPUT.put_line('----------------Applications SSO Login Types Profile Updated to LOCAL-------------');
DBMS_OUTPUT.put_line('-------------------------Profile Updatation Started  -----------------------------');
FOR I IN UID LOOP
--L_SUCCESS := FND_PROFILE.SAVE('APPS_SSO_LOCAL_LOGIN','LOCAL','USER',i.user_id);
L_SUCCESS := FND_PROFILE.SAVE('APPS_SSO_LOCAL_LOGIN','SSO','USER',i.user_id);
IF L_SUCCESS
THEN
DBMS_OUTPUT.put_line(i.user_name||'==>'||'Success');
ELSE
DBMS_OUTPUT.put_line('Profile Update Failed . Error:'||sqlerrm||i.user_name);
END IF;
COMMIT;
END LOOP;
 DBMS_OUTPUT.put_line('--------------------------Profile Updatation Completed------------------------------');
end;


API to Update Profile Value - Local to SSO


DECLARE
L_SUCCESS BOOLEAN;
CURSOR uid is
SELECT user_name,user_id from fnd_user where user_name in
(select user_name from apps.fnd_user where email_address in
(select email_address from apps.per_all_people_f where 1=1 and employee_number in ('215677'
)));
BEGIN
DBMS_OUTPUT.put_line('----------------Applications SSO Login Types Profile Updated to LOCAL-------------');
DBMS_OUTPUT.put_line('-------------------------Profile Updatation Started  -----------------------------');
FOR I IN UID LOOP
L_SUCCESS := FND_PROFILE.SAVE('APPS_SSO_LOCAL_LOGIN','LOCAL','USER',i.user_id);
--L_SUCCESS := FND_PROFILE.SAVE('APPS_SSO_LOCAL_LOGIN','SSO','USER',i.user_id);
IF L_SUCCESS
THEN
DBMS_OUTPUT.put_line(i.user_name||'==>'||'Success');
ELSE
DBMS_OUTPUT.put_line('Profile Update Failed . Error:'||sqlerrm||i.user_name);
END IF;
COMMIT;
END LOOP;
 DBMS_OUTPUT.put_line('--------------------------Profile Updatation Completed------------------------------');
end;