Monday 22 January 2018

How we can send Workflow notification to particular approver in Customized workflow

 How we can send Workflow notification to particular approver in Customized workflow


send notification to particular approver:
lets suppose we pass the approver user_name in varialbe send_to_email;

first we find the approver user_id  like cmd --- 1234

then we find its user_name from fnd_users
where user_id=1234(approver_id);

to send notification to any user id one thing  necessary is that they have must register in table wf_local_roles.

so we in workflow we create a function like name 'set role' in back end we check it in table wf_local_roles there is any record for this user name.
if it is exists then ok other wise we create role.
v_role_email := upper(wf_engine.getitemattrtext(itemtype => itemtype
                                                   ,itemkey  => itemkey
                                                   ,aname    => 'SEND_TO_EMAIL'));
    SELECT COUNT(*)
    INTO   n_ctr
    FROM   wf_local_roles
    WHERE  NAME = v_role_email;
if n_ctr=0 then we create role

wf_directory.createadhocrole(role_name               => v_role_email
                                  ,role_display_name       => v_role_email
                                  ,role_description        => v_role_email
                                  ,notification_preference => 'MAILHTML'
                                  ,email_address           => v_role_email
                                  ,status                  => 'ACTIVE'
                                  ,expiration_date         => NULL);
end;
wf_engine.setitemattrtext(itemtype => itemtype
                             ,itemkey  => itemkey
                             ,aname    => 'SEND_TO_ROLE'
                             ,avalue   => v_role_email);
    RESULT := 'COMPLETE:Y';
    RESULT := 'COMPLETE:Y';
end;

if you found this post helpful and you liked it then follow this blog to get notifications for the upcoming posts.

now we set in variable send_to_role the approver name where this notification goes
now we create a function with type or icon "Notification" and in notification tab in function name field we provide the function according to the response type
and 2nd main thing in notification function is that we have to set the performer(which accept or approve the notification) in Node Tab --> we goes to Performer section --> in performer section we set Type=item attribute
and Value='send To Role'

2 comments:

Anonymous said...

Good blog, Thanks for sharing this informative article. It would be helpful to all if you write a full article.
Oracle Fusion HCM Online Training"

Goutham Raj said...

Good Article, Alots of information provided, Thanks for sharing this information.
Oracle Fusion HCM Online Training

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *