Knowledge about both areas - Purchase Requisition functionality and custom events required to answer your question. I don’t know much about Purchase Requisition so could you please get me the following information so I can try to answer.
- What is the out of box (OOB) email Event you have used here?
- What is exact problem you get when this out of box email event is used? What is missing there?
- What is the LU and table that you used to create the custom event?
Considering the LU and the table you have used for the custom event, we will need to find a column that changes in each step. For example that column’s value should be changed when department approves, CFO approves and then the CEO approves. We might need to write 3 custom events (or 3 custom event actions) using some conditions in this case.
Also we will see if someone has both knowledge areas and suggest a direct answer that helps you in this case.
You have that OOB event what is trickered as you want. Can you just change event action of that?
Or change action to sql type action, then you can fetch more data etc if you need. After that you can send mail from code or with another event.
But as Rusiru wrote, more details would help. ;)
The OOB event is called PUR_REQ_LINE_TO_BE_AUTHORIZED. The message text that comes out of this event is very generic (Requisition No: #######, Line No: #, Part No: aaaaaaa, Step No: ##) We created a copy of this event action and can get something a bit less generic. We want more fields to be added to the event. This drove us to create our own event and the problem is with the logic that steps through and sends the email. It goes to everyone on the Approval List after each step. We are looking to add Site, Supplier Name, Requisitioner Name, Part Description, Purchase Group, QTY, Price, Total Amount. This information we have on our event that we created, I’m just looking at the logic/process
The LU is PURCH_REQ_LINE_APPROVAL and the Table is tbwAuthorizationLines
I’m really hoping there is a pretty straight forward way to get the logic from the OOB event.
OOB logic is inside api code, so not directly available or possible to use.
So you can use existing OOB event. Create sql event action. Add there needed get or select searches to fetch needed extra data.
Create new event (or use that what you already have made) and call that from original sql event action.
Unfortunately I don’t have just now time to create better example, but maybe you get idea from below.
declare
arg_ VARCHAR(32000);
msg_ VARCHAR(32000);
BEGIN
--here cursor or get function to fetch extra data
--add data to msg attr, these are the values used in another event
Client_SYS.Clear_Attr(msg_);
Message_SYS.Add_Attribute(msg_, 'NEW:DELNOTE_NO','&NEW:DELNOTE_NO' );
Message_SYS.Add_Attribute(msg_, 'NEW:CONTRACT','&RECEIVER' );
--add data to event attr
Client_SYS.Clear_Attr(arg_);
Client_SYS.Add_To_Attr('EVENT_LU_NAME_', 'ExtDispatchAdvice', arg_);
Client_SYS.Add_To_Attr('EVENT_ID_', 'xxxx_AUTO_RECEIVE_B', arg_);
Client_sys.add_to_attr('EVENT_DATA_',msg_,arg_);
--call another event
Transaction_SYS.Deferred_Call('EVENT_SYS.Event_Execute', 'PARAMETER', arg_, 'Event xxx_AUTO_RECEIVE');
END;