Skip to main content
Solved

Execute Event from Command - EVENT_SYS.EVENT_EXECUTE

  • October 16, 2024
  • 8 replies
  • 240 views

Forum|alt.badge.img+3
  • Do Gooder (Partner)
  • 9 replies

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

 

 

Best answer by colekenna

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.

View original
Did this topic help you find an answer to your question?

8 replies

dsj
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 866 replies
  • October 30, 2024

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


Forum|alt.badge.img+2
  • Do Gooder (Partner)
  • 7 replies
  • January 21, 2025

Hi ​@dsj 

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

 

Thank you!

Krzysztof


Forum|alt.badge.img+3
  • Do Gooder (Customer)
  • 5 replies
  • March 19, 2025

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?


Forum|alt.badge.img+3
  • Do Gooder (Customer)
  • 5 replies
  • Answer
  • March 24, 2025

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.


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Partner)
  • 9 replies
  • April 30, 2025

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


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Partner)
  • 9 replies
  • April 30, 2025

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

 


Forum|alt.badge.img+3
  • Do Gooder (Customer)
  • 5 replies
  • May 1, 2025

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.


Forum|alt.badge.img+3
  • Author
  • Do Gooder (Partner)
  • 9 replies
  • May 1, 2025

 

@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!

 


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings