Wednesday, 24 January 2018

Workflow Customization : How to send Supplier PO notification with PO attachment through Workflow in Oracle apps


Workflow Customization : How to send Supplier PO notification with PO attachment through Workflow in Oracle apps

In friends , in this post I will show you how we can send notification to supplier with PO attachment automatically when PO will approved in the system. You can achieve this things either by standard feature also but that thing you need to do many setups. I have also achieved this same requirement through Workflow Customization.

Step1:- Open the PO approval workflow In workflow builder and then click on Attribute as below.


 
Step2:- Right Click and create new Attribute as below.
 
 
Step3:- Now Click on PO Approval Top Processes as below.
 
 
 
 
 
Step4:-  This is the standard function which send Notification to Buyer when PO approved. We will merge our Custom Notification to Send Notification to supplier with this Notification Function.
 
 
 
Step5:- Right Click on the screen and Click New Function.
 
 
 
 Step6:- Give  the Value to the Function and give function name as plsql procedure which we will create next.
 
 
 
 
Step7:-
 
 
 
 
Step8:- Now again right click on screen and click New Notification.
 
 
 
if you found this post helpful and you liked it then follow this blog to get notifications for the upcoming posts. 
 
Step9:-Give the Value to Notification function as below.
 
 
 
Step10:- Now Click on Node Tab of Notification Function as select Performer as below.
 
 
 
Step11:- This is the Complete Picture of the process.
 
 

 

Step12:-


This is the PLSQL stored procedure we will use in Workflow builder functions. In this Procedure, we are setting the value of supplier Email address in Workflow attribute XX_SUPPLIER_EMAIL so that workflow will send notification to SUPPLIER.

Step1:-  Create PLSQL stored procedure as below.

CREATE OR REPLACE PROCEDURE XX_PONOTIF_TO_SUPPLIER(p_item_type    IN VARCHAR2,p_item_key    IN VARCHAR2,p_actid        IN NUMBER,p_funmode        IN VARCHAR2,p_result     OUT NOCOPY VARCHAR2 )
IS
v_agent_id NUMBER;
v_VENDOR_id NUMBER;
V_SUPPLIER_EMAIL VARCHAR2(4000);
V_ROLE_NAME VARCHAR2(4000);
BEGIN
BEGIN

SELECT pha.VENDOR_ID
into v_VENDOR_id
FROM apps.wf_items wi ,APPS.PO_HEADERS_ALL pha
WHERE wi.item_type='POAPPRV'
and wi.item_key=p_item_key
and wi.user_key = pha.segment1;

select SUPPLIER_EMAIL
into V_SUPPLIER_EMAIL
from apps.ap_suupliers_all
where vendor_id=v_VENDOR_id

 SELECT COUNT(*)
  INTO   n_ctr
  FROM   wf_local_roles
 WHERE  NAME = V_SUPPLIER_EMAIL;
if n_ctr=0 then
wf_directory.createadhocrole(role_name               => V_SUPPLIER_EMAIL
                                  ,role_display_name       => V_SUPPLIER_EMAIL
                                  ,role_description        => V_SUPPLIER_EMAIL
                                  ,notification_preference => 'MAILHTML'
                                  ,email_address           => V_SUPPLIER_EMAIL
                                  ,status                  => 'ACTIVE'
                                  ,expiration_date         => NULL);
         
          ELSE
SELECT NAME
    INTO   V_SUPPLIER_EMAIL
    FROM   wf_local_roles
    WHERE  NAME = V_SUPPLIER_EMAIL;
end if;
wf_engine.setitemattrtext(itemtype => itemtype
                             ,itemkey  => itemkey
                             ,aname    => 'XX_SUPPLIER_EMAIL'
                             ,avalue   => V_SUPPLIER_EMAIL);

EXCEPTION WHEN OTHERS THEN
AP_WEB_UTILITIES_PKG.logProcedure('ERROR IN SUPPLIER EMAIL', 'sqlerrm'||sqlerrm);
END;



wf_engine.setitemattrtext(
itemtype => p_item_type
,itemkey  => p_item_key
,aname    => 'XXSEND_TO_SUPERVISOR'
,avalue   => V_ROLE_NAME);

p_result :='Y';

EXCEPTION WHEN OTHERS THEN

p_result :='N';

END;


If you want to see Other OAF Related Posts , Please visit Below URL.
https://rpforacle.blogspot.in/2013/03/oaf_10.html

If you want to see  Oracle Fusion Related Posts , Please visit Below URL.

https://rpforacle.blogspot.in/2018/01/oracle-fusion-learning-tutorial.html
If you want to Learn Oracle Workflow Builder, Please visit Below URL.
https://rpforacle.blogspot.in/2018/01/oracle-workflow-learning-tutorial-1.html
 

0 comments:

Post a Comment