Friday, April 19, 2019

Oracle API For OAF Personalization Profile Options 11.5 to 12.2 ERP

/*
FND: Diagnostics  - Yes  -  FND_DIAGNOSTICS
Hide Diagnostics menu entry - No - FND_HIDE_DIAGNOSTICS
SLA: Enable Diagnostics - Yes - XLA_DIAGNOSTIC_MODE
Utilities:Diagnostics  - Yes - DIAGNOSTICS
FND: Enable Personalization Workbench - Yes - FND_ENABLE_PERSONALIZATION_WORKBENCH
Personalize Self-Service Defn - Yes - FND_CUSTOM_OA_DEFINTION
FND: Personalization Region Link Enabled -  Yes - FND_PERSONALIZATION_REGION_LINK_ENABLED
FND: Personalization Seeding Mode - Yes - FND_PERSONALIZATION_SEEDING_MODE
FND: Debug Log Enabled - No -  AFLOG_ENABLED (Turn Off Low-Level Diagnostic Logging)
*/


DECLARE
  l_resp_id     NUMBER;
  l_resp_app_id NUMBER;
  l_success     BOOLEAN;
 
  l_user_id   NUMBER;
 
BEGIN
SELECT USER_ID INTO l_user_id  FROM FND_USER WHERE USER_NAME = 'USERNAME' ;
  l_success := FND_PROFILE.save
               ( x_name                 => 'FND_DIAGNOSTICS'
               , x_value                => 'Y'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile FND: Diagnostics Updated successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile FND: Diagnostics Update Failed at User Level. Error:'||sqlerrm);
  END IF;
 
  l_success := FND_PROFILE.save
               ( x_name                 => 'FND_HIDE_DIAGNOSTICS'
               , x_value                => 'N'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile Hide Diagnostics menu entry Updated successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile Hide Diagnostics menu entry Update Failed at User Level. Error:'||sqlerrm);
  END IF;
 
   l_success := FND_PROFILE.save
               ( x_name                 => 'XLA_DIAGNOSTIC_MODE'
               , x_value                => 'Y'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile SLA: Enable Diagnostics  Updated successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile SLA: Enable Diagnostics   Update Failed at User Level. Error:'||sqlerrm);
  END IF;
 
     l_success := FND_PROFILE.save
               ( x_name                 => 'DIAGNOSTICS'
               , x_value                => 'Y'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile Utilities:Diagnostics successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile Utilities:Diagnostics Failed at User Level. Error:'||sqlerrm);
  END IF;
 
 
 
     l_success := FND_PROFILE.save
               ( x_name                 => 'FND_ENABLE_PERSONALIZATION_WORKBENCH'
               , x_value                => 'Y'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile FND: Enable Personalization Workbench successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile FND: Enable Personalization Workbench Failed at User Level. Error:'||sqlerrm);
  END IF;
 
       l_success := FND_PROFILE.save
               ( x_name                 => 'FND_CUSTOM_OA_DEFINTION'
               , x_value                => 'Y'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile Personalize Self-Service Defn successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile Personalize Self-Service Defn Failed at User Level. Error:'||sqlerrm);
  END IF;
 
 
         l_success := FND_PROFILE.save
               ( x_name                 => 'FND_PERSONALIZATION_SEEDING_MODE'
               , x_value                => 'Y'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile FND: Personalization Seeding Mode successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile FND: Personalization Seeding Mode Failed at User Level. Error:'||sqlerrm);
  END IF;
 
         l_success := FND_PROFILE.save
               ( x_name                 => 'FND_PERSONALIZATION_REGION_LINK_ENABLED'
               , x_value                => 'Y'
               , x_level_name           =>  'USER'  -- 'SITE' , 'APPL' , 'RESP' , 'USER'
               , x_level_value          => l_user_id --   null for site , application id, responsibility id , , User Id 
               , x_level_value_app_id   => NULL --  only for responsibility - l_resp_app_id
               ) ;
  IF l_success
  THEN
     DBMS_OUTPUT.put_line('Profile FND: Personalization Region Link Enabled successfully at User Level');
  ELSE
     DBMS_OUTPUT.put_line('Profile FND: Personalization Region Link Enabled Failed at User Level. Error:'||sqlerrm);
  END IF;
  Commit;
END;
/

No comments:

Post a Comment