244
Views
10
Comments
Solved
Get two different values in the notify message
Question

I have a Popup_Editor_Notify with argument "tr.List.Current.Prod.Cod+ "," + IsAvailable" to store two different values, then in other action I want to create a variable with the value in Prod.Cod and other variable with the value in IsAvailable.

 

The NotifyWidgetGetMessage() returns the two values but do you know how to acces each value separately? So that is possible to store each value in a different variable? 

2020-02-28 09-46-54
Eduardo Jauch
Solution
2019-06-15 21-39-22
Afonso Carvalho
 
MVP

If you only need to pass a couple of values, you can define a separator (a special character that you know will only be used to split your values), append the strings, send it in the Popup_Editor_Notify action, and then split the output of NotifyWidgetGetMessage() with String_Split.

2020-02-28 09-46-54
Eduardo Jauch

Hi OsCaR_

The way I do is to use the String_Split function from Text extension.
You pass the message and the delimiter, and it will return you a Text List.

From there you can access the values separately (and eventually convert to the correct data type and store in variables, use, etc).

Cheers.

UserImage.jpg
OsCaR_

Eduardo Jauch wrote:

Hi OsCaR_

The way I do is to use the String_Split function from Text extension.
You pass the message and the delimiter, and it will return you a Text List.

From there you can access the values separately (and eventually convert to the correct data type and store in variables, use, etc).

Cheers.


Thanks so the NotifyGetmessage is the text that is passed in the function? It shows text data type required instead of text record list. 

2020-02-28 09-46-54
Eduardo Jauch

It is an action that will return the message.

NotifyGetMessage.Message (if I remember well).

Cheers.

UserImage.jpg
OsCaR_

It shows data type requirwd instead of text record list. 

2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Do you mean the output of String_Split? It will be a text record list, you'll have to iterate or access specific records. Could you show us a screenshot of what you're attempting?

UserImage.jpg
OsCaR_

I have the Popup_Editor_Notify with argument "tr.List.Current.Prod.Cod"," + IsAvailable" then in other action 

using the NotifyWidgetGetMessage() I want to store the value in "tr.List.Current.Prod.Cod" in a variable and the value in "IsAvailable" in other variable.

UserImage.jpg
OsCaR_

The return of NotifyWidgetGetMessage is "8002,True".

2020-02-28 09-46-54
Eduardo Jauch
Solution

2018-10-17 18-00-19
Carlos Gonçalves

Hello 


Other solution is to use a structure with the parameters you need to pass to the screen.

 you serialize the record to json and send the json on the notify.


On the other side you will get a message that is a json text  then you only need to deserialize to record and you have your record..


I made a sample so you can check both cases.


BR

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