send structures as parameters in notify widget

By Luciano Schiavo on 27 Jul

Use of complex structures (registers or structures) can help the behaviour of other screens and blocks. For instance, a block where I have a Save & New button can send some text and boolean fields to update the caller screen and continue to capture more descriptions. 

It's not hard to serialize them into text and send them, I do this pretty often. The problem is how notify widget works, I don't think there is any way to have it receive anything other than a string.


J.Ja

I agree that there are ways to workaround it. But it would be easier to work in the same way as registers or structures. Every hard work would be on the platform instead of our hands. Is not it the general idea of OS ?

Luciano -


Yes, however, that is not technically possible with this. It MUST send a string. And in addition, OutSystems doesn't overload methods/Actions. So yeah, you need to serialize it.

J.Ja

Sorry but I didn´t understand. Why this is not technically possible ? What is the problem to send the table structure or record instead of string inside the environment ?

Because the system isn't dynamically typed, that's why.

Try to make an Action that accepts any kind of Structure, or lets you use the output in an Assign to any kind of Structure, and you will see the problem.

J.Ja

It is simple... see one example below

Today every action uses any kind of parameters. Why doesn´t allow to use them inside the notify ?

It is simple... see one example below

Today every action uses any kind of parameters. Why doesn´t allow to use them inside the notify ?


Your example has nothing to do with passing a "Structure" into an Action and expecting that Action to magically know what the Structure layout is, and properly type it.

J.Ja

Or put it another way... show me a single place in the system where you can pass a Structure and the system doesn't care what the record layout is, WITHOUT using ToObject... I'll be in the corner taking a nap while you look. Then you need to find me an example of the system having "Structure" as the output without having a defined record layout AND you can assign that to a Sructure that *does* have a defined record layout.

This is not the way the system works. It is not C# or Java, it is an extremely strongly typed language without the concept of interfaces or inheritance or duck typing or dynamic types, which would make this work.

J.Ja