Tuesday, April 8, 2014

Scripts for Roles - User in Workflow


– Script to Create oracle workflow ad hoc roles

DECLARE
lv_role varchar2(100) := 'ERPSCHOOLS_DEMO_ROLE';
lv_role_desc varchar2(100) := ' ERPSCHOOLS_DEMO_ROLE';
BEGIN
wf_directory.CreateAdHocRole(lv_role,
lv_role_desc,
NULL,
NULL,
'Role Demo for erpschool users',
'MAILHTML',
'NAME1 NAME2', --USER NAME SHOULD BE IN UPPER CASE
NULL,
NULL,
'ACTIVE',
NULL);
commit;
dbms_output.put_line('Created Role' ||' '||lv_role);
End;
/



– Script to Add user to already existing Adhoc Role

DECLARE
v_role_name varchar2(100);
v_user_name varchar2(100);
BEGIN
v_role_name := 'ERPSCHOOLS_DEMO_ROLE';
v_user_name := 'NAME3'; --USER NAME SHOULD BE IN UPPER CASE
WF_DIRECTORY.AddUsersToAdHocRole(v_role_name, v_user_name); --USER NAMES SHOULD BE in CAPS
commit;
END;
/



– Script to Remove user from existing Adhoc Role

DECLARE
v_role_name varchar2(100);
v_user_name varchar2(100);
BEGIN
v_role_name := 'ERPSCHOOLS_DEMO_ROLE';
v_user_name := 'NAME3'; --USER NAME SHOULD BE IN UPPER CASE
WF_DIRECTORY.RemoveUsersFromAdHocRole(v_role_name, v_user_name); --USER NAMES in CAPS
commit;
END;
/



– workflow ad hoc Role Tables

select * from WF_ROLES;

select * from WF_USER_ROLES;

select * from WF_LOCAL_ROLES;

select * from WF_USER_ROLE_ASSIGNMENTS;

Forms Personalization

Why personalization?
  • Oracle Supports personalization unlike customization
  • Personalizations are stored in tables rather than files
  • Will not have a bigger impact when you upgrade or apply patches to the environment
  • Can be moved easily through FNDLOAD from one instance to other
  • Can be restricted at site/responsibility/user level
  • Easy to disable/enable with click of a button.
  • Personalization will store who columns with which we have the ability to track who created/modified it where as in CUSTOM.PLL we don’t have that ability.
  • Can be applied to new responsibilities/users easily.
  • Can be restricted to function or form.
What can be done through personalization?
  • Zoom from one form to another
  • Pass data from one form to another through global variables
  • Change LOV values dynamically
  • Enable/Disable/Hide fields dynamically
  • Display user friendly messages when required
  • Launch URL directly from oracle form
  • Execute PL/SQL programs through FORM_DDL package
  • Call custom libraries dynamically