Hi Everyone,
Can anyone please guide me on how to write a custom code in Post_Data_Process_Handlers_Pkg? My scenario is I have to calculate the unique samaccountname for the user based on 1st name and lastname
something like this -- ACCNAME := substr(p_fname,1,1) || '.' || p_lname; Also, I have a logic to check with T_AV_ACCOUNTS table for check if any account exists and then append 1, 2,.... to ACCNAME if the account exists.
I would like to know how do I write this logic (any sample template of custom code will be helpful) in Post_Data_Process_Handlers_Pkg so that post unification user samaccountname is ready and so can be provisioned into AD and exchange for email.
Hi... You can place any valid code in the relevant procedure. When you want to update an attribute on users post unification, you should be using the procedure Post_Data_Process_Handlers_Pkg.Post_ID_Unification_Handler
You can change this procedure to add any valid SQL statement and recompile the package. The added SQL will then run from next unification onwards. The SQL depends on your requirement. I am giving very rough example of SQL that you can add in the procedure to update a specific user attribute.
Ex: Update user attribute with firstname.last_name and append 1 when there is already account for user.
update t_master_enterprise_users usr set CUS_ATTR_USER_CAS_7 = first_name || '.'
|| last_name || (case when (select count(*) from t_av_user_account_mappings map where user_id = usr.id and map.deletion_date is null) > 0 then '1' else '' end);