251
Views
8
Comments
[Event System] Passing record argument to parent
Question
event-system
Web icon
Forge asset by Leonardo Fernandes
I am trying to use the ProvideArgumentRecord, Trigger, and GetArgumentRecord actions from the Event System to pass a structure from a child web block to the parent.

On my child web block screen action I have the ProvideArgumentRecord with a local record that has one attribute of the structure I want, defined in the child web block's module. After the provide action I have the Trigger action which fires the parent's event given as input parameters.

On my parent web block I have the On Notify screen action for the child using the GetArgumentRecord action. Once it reaches this action, I get an exception of the following message:

EmptyList record type is incompatible: expected ssW_Widgets_UI.RCFormattedAddressArgumentsRecord, found ssW_ThemeNew_UI.RCFormattedAddressArgumentsRecord

It seems like it is trying to use a local version of the same record definition even though I am simply referencing the data type (FormattedAddressArguments) from the child web block's module to the parent. (W_Widgets_UI being the child and W_ThemeNew_UI being the parent).

Maybe I'm using these actions incorrectly or what I'm trying to do isn't even possible. Any help much appreciated!
2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Hi Brian. You are using those actions correctly, but this is a limitation at the present - hopefully I will work it out shortly.

However, you can work around this problem if you wrap the calls to ProvideArgumentRecord and GetArgumentRecord into your own API. This is explained in Lesson 07 - architect your events, but in your scenario you will also need to wrap the GetArgumentRecord action. Here's how you should do it:

1. In W_Widgets_UI eSpace, create two user actions: NotifyFormattedAddress, and GetNotifiedFormattedAddress (names are simply suggestions).
2. NotifyFormattedAddress should receive a record of your structure, and invoke ProvideArgumentRecord, and InvokeNotifyWidget.
3. GetNotifiedFormattedAddress should output a record of your structure, and invoke GetArgumentRecord inside.
4. Replace the events in your application to use those actions, instead of directly using the Event System API.

Let me know if that worked for you.
Leonardo Fernandes
2015-11-12 15-37-39
Brian Gall
Hi Leonardo,

I followed those instructions and it is now working! Thanks for the help and quick response!
2023-10-19 08-04-17
David Fragoso
Brian Gall wrote:
Hi Leonardo,

I followed those instructions and it is now working! Thanks for the help and quick response!
 Hi Brian,

Can you attach your oml where you made that test.

Best regards,

David Fragoso
 
2019-07-08 11-04-35
Leonardo Fernandes
 
MVP
Hi Brian, I was able to lift that limitation on the last version of the Event System component.
Now you can use record-type arguments and return values in producer-consumer scenarios.
2015-11-12 15-37-39
Brian Gall
Thanks Leonardo, I'll give that a shot next time I get the chance. However, I'm tending to wrap these calls in actions anyway as you stated. It gives me references I can find usage of and update easily.
2024-10-25 09-14-42
Christopher Bautista

Brian Gall wrote:

Thanks Leonardo, I'll give that a shot next time I get the chance. However, I'm tending to wrap these calls in actions anyway as you stated. It gives me references I can find usage of and update easily.

Hi Brian,

Can you please share a sample OML


Thanks and regards,

Chris


2019-07-08 11-04-35
Leonardo Fernandes
 
MVP

Christopher, you can take a look on how to use the arguments on Lesson 06 - architect your events. At the bottom of the lesson there's a link to download the code, which you can publish and inspect.

UserImage.jpg
Andre Goncalves

Hi @Leonardo Fernandes ,

Could you please share with us a sample OML with an example on how to use the event arguments? Unfortunately, your page does not work anymore, and we don't have a way to get the examples.

Thanks and regards,

André

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.