How to get the record info in a popup from parent

How to get the record info in a popup from parent

  

Hi there,

Here is a question for me.

I need to open a popup from a screen.And select something from the popup.

When I close the popup.I need to pass the info I had selected to the parent screen.

For now, I did it by save the info into the session,and get it from the session during the OnNotify action.

Is there any other way to do this without session?

Hello Fuliang,

I recommend you the online training, as this topic is covered there.

Up to version 10, you can use a Popup_Editor_Notify in the Popup screen action to send a message to its parent.

In the parent, in the OnNotify associated screen action, you can use the NotifyGetMessage to retrieve the message. In version 11 this action is deprecated, but still available.

Cheers.

P.S. The message will be serialized and will get to the parent as text, where you will have to deserialize. But it is better (usually) than use session variables.

But if you are passing a full record, I would advise you to review your logic, as this is not efficient, be through message or session variable (which will have negative impact in every request in the application).

Eduardo Jauch wrote:

P.S. The message will be serialized and will get to the parent as text, where you will have to deserialize. But it is better (usually) than use session variables.

But if you are passing a full record, I would advise you to review your logic, as this is not efficient, be through message or session variable (which will have negative impact in every request in the application).


Thanks Eduardo, I get it.

Hi fuliang wei,

As Eduardo suggested you need to use Popup_Editor_Notify() to send you data back to your parent screen and NotifyGetMessage() function to catch that data . If you want to send a record or list of type some structure , it will be better to use Json . you can serialize you data into json format and then de-serialize it when you receive it in parent side .

He Fuliang Wei,

To help you on your way I made an example of how you can use Notify and JSON to get information from a popup, for example out of a form, to the parent screen.

On the left of the image you can see the essential part of the logic in the popup screen and on the right the logic needed in the OnNotify screen action of the parent screen. In the Popup logic you set the JSONSerialize1.JSON as an argument for the Popup_Editor_Notify and in the OnNotify logic you set the Deprecated_NotifyMessage.Message as the JSON String for the JSONDeserialize Example (see details on the bottom of the image).

In this example I choose to use a structure to temperorily store the information after which you can use it in either an assign and (Local) Variable or save the information in a Create of CreateAndUpdate action (both options shown in logic).




Hopefully this will help you with your problem.

Cheers,

Daan