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


Hi ​@dsj 

Where do you add this message sending parameters to the event?

 

Thank you!

Krzysztof


Anyone find a solution to this? I am trying to pass parameters through the ExecuteAction to the custom event as well. I’ve yet to find anything online on how to do this from the page designer where the ExecuteAction is defined.

 

Right now I’m passing a value to the Event_Data_ parameter but, like the original poster said, it isn’t clear what the syntax is needed to assign it to the parameter(s) in the custom event.

 

If the custom event has the OLD:ORDER_NO field, how does one assign the correct data from the ExecuteAction to that field?


Kalindu, I seem to have found a solution. When creating the ExecuteAction, the Event_Data_ parameter can pass a value to an attribute on the called event with the following syntax:

$OLD:VALUE=${FIELD}

Where VALUE is the name of the attribute on the event, and FIELD is a value from the page you’re creating the ExecuteAction button on. Switch out OLD with NEW as necessary.

I am unsure how to pass more than one, haven’t had time to test it further.


Hi ​@colekenna,

 Thank you for posting your solution. I am still unable to get it to work!!

Where did you define $OLD:VALUE=${FIELD} ? 
Did you define this as a Custom Attribute for the Event?

or is it a part of the PLSQL block?


Please let me know what exactly you did.

 

Thank you!
/Kalindu


EDIT: Sorry ​@colekenna, I misunderstood.
You meant, 
For EVENT_DATA_ Put  $OLD:VALUE=${FIELD} as the value! 
 

My Event is based on a custom entity which has an Attribute called CF$_NAME. 

I tried this, and tried printing the value from the event, but it was printing “CF$_NAME’ instead of printing the value.

Any idea on that?
Thank you!!
Kalindu

 


Hello ​@Kalindu,

 

Just to double check, because I’ve made the mistake before, did you click on the plus sign after entering the Event_Data_ info?

 

Otherwise, I’m not sure what could be causing your issue. Perhaps removing the $ symbol in CF$_NAME? I haven’t seen a variable with $ in it before, so thats my only guess.

 

Let me know if the issue persists.


 

@colekenna ,

I tried on a non custom field and it actually worked! Thanks alot!
Let me know if you figure out  a way to send multiple values!

Cheers!

 


Hello again Kalindu,

 

I’ve recently had a need to sent multiple values through the method we discussed. Turns out its as simple as adding a comma and removing the unnecessary dollar signs. For example:

NEW:ORDER_NO=${OrderNo},NEW:ROWSTATE=${Objstate}

This will send the OrderNo and Objstate fields into the corresponding fields on the event.

 

Let me know if you have any issues.


Reply