Monday, February 20, 2017

Script to Add Responsibilities

SET serveroutput ON
DECLARE
  ln_user_id NUMBER;
  ln_resp_id NUMBER;
  ln_app_id  NUMBER;
  CURSOR c1
  IS
    SELECT responsibility_id,
      application_id,
      responsibility_name
    FROM fnd_responsibility_tl
    WHERE responsibility_name   IN ( 'Application Developer', 'Functional Administrator','System Administrator')
    AND responsibility_name NOT IN
      ( SELECT DISTINCT rtl.responsibility_name
      FROM apps.fnd_compiled_menu_functions cmf,
        apps.fnd_form_functions ff,
        apps.fnd_form_functions_tl ffl,
        apps.fnd_responsibility r,
        apps.fnd_responsibility_tl rtl,
        apps.fnd_user_resp_groups urg,
        apps.fnd_user u
      WHERE cmf.function_id     = ff.function_id
      AND r.menu_id             = cmf.menu_id
      AND urg.responsibility_id = r.responsibility_id
      AND rtl.responsibility_id = r.responsibility_id
      AND cmf.grant_flag        = 'Y'
      AND r.application_id      = urg.responsibility_application_id
      AND u.user_id             = urg.user_id
      AND u.user_name           = 'KAARTHIB'
      AND ff.function_id        = ffl.function_id
      );
BEGIN
  SELECT user_id INTO ln_user_id FROM fnd_user WHERE user_name = 'KAARTHIB';
  FOR i IN c1
  LOOP
    fnd_user_resp_groups_api.insert_assignment (ln_user_id, i.responsibility_id, i.application_id, NULL, SYSDATE, NULL, NULL );
  END LOOP;
  COMMIT;
END;
/

Script to update Application User Password

SET SERVEROUTPUT ON
DECLARE
  v_user_name    VARCHAR2(30):=upper('USER');
  v_new_password VARCHAR2(30):='PASSWORD';
  v_status       BOOLEAN;
BEGIN
  v_status   := fnd_user_pkg.ChangePassword ( username => v_user_name, newpassword => v_new_password );
  IF v_status =true THEN
    dbms_output.put_line ('The password reset successfully for the User:'||v_user_name);
    COMMIT;
  ELSE
    DBMS_OUTPUT.put_line ('Unable to reset password due to'||SQLCODE||' '||SUBSTR(SQLERRM, 1, 100));
    ROLLBACK;
  END IF;
END;
/

Friday, February 17, 2017

FRM-10102: Cannot attach PL/SQL library

Hi All , Many of you might have faced the "FRM-10102: Cannot attach PL/SQL library" issue while opening a oracle form locally in your machine.To avoid the issue (Forms 10g) we should perform the following steps.

Assuming you stored all your FMB and PLL files in D:\resource folder (copied from your server).

Add the path D:\resource in the FORMS_PATH registry entry.
Or
Create a Environment variable named FORMS_PATH and add the value D:\resource

You might still face the issue if you didn't download the complete resource folder from your server.

Copying the complete resource folder from server is a time consuming process. Instead copy the required PLL which was shown in the error window. After closing the PLL missing error window, try to manually add any one PLL once you open the form.It will start asking the basic PLL files ( like APPCORE,JL,JA,FNDSQF,etc) . It will be about 30 to 40 files which you need to download and move to the resource folder. After that close the form and reopen it. Now it will open without any error.

Please update your comments if you still face any issues even after performing the above steps.