Skip to main content

Hi,  

 I am trying to trigger a Custom Event from a Command Button in Cloud 22R2. 

I created a projection action and selected the method: 

EVENT_SYS.EVENT_EXECUTE


And in my page, I created a command button of type Execute Action,

and selected the projection action I created. 
In the Parameters, I entered my Event LU and Event ID. 
Which seems to work fine. The event is executed correctly. 

But how do I pass a parameter to the custom event? 
I can select attributes in the EVENT_DATA parameter, but I dont seem to be able to fetch that from the Custom Event. Lets say I select ‘WoNo’  into EVENT_DATA,   how do i  use that WoNo in my event action?

 

(This is cloud 22R2 so using a command button to execute a workflow is not possible)

 

Thank you!
Kalindu

 

 

Hi @Kalindu 

Try following snippet for constructing the message to send to the event.

In this example, it adds value to NEW:WO_NO attribute. you can use it in the event action as &NEW:WO_NO.

For safeguard, I usually keep the event enabled without adding and Fire When actions.

  DECLARE
msg_ VARCHAR2(32000);
BEGIN
msg_ := MESSAGE_SYS.Construct('EVENT_ID');
MESSAGE_SYS.add_attribute(msg_,'NEW:WO_NO', wo_value);
IF (EVENT_SYS.event_enabled('EventLU', 'EVENT_ID')) THEN
EVENT_SYS.event_execute('EventLU','EVENT_ID',msg_);
END IF;
END;

 

Hope it helps!

Damith


Reply