23
Views
5
Comments
Solved
Send message on opening screen
Question
Application Type
Reactive
Service Studio Version
11.54.31 (Build 62912)

I want to validate data on opening a screen and either send a message or have an expression that lists what needs to be verified.

OnRender seemed the best place to do this but I'm changing local variables on validate so that I can track what needs to go in the message/expression. I have the following warning:

  • Potential Loop at runtime - 'OnRender' changes the CustomerReview's data, which triggers the on render event again. To avoid infinite rendering loops, don't change screen or block data in 'OnRender'.

How can I make this happen when transitioning to this screen?


Champion
Solution

Hi,

From above screenshot its clear that you are accessing data from aggregate (GetCustomerById.List.current... ). So you can use onAfterFetch action of this aggregate to check the condition. Please let me know if am missing something to understand.

regards

@Vikas Sharma Running the aggregate OnRender will still cause a loop. What can I do to trigger the aggregate when opening the screen?

Champion

Hi,

You don't need to do anything special. It will run automatically on screen load. You only need to ensure that it runs on screen start. For this Fetch property value should be AtStart.  Also now we are writing logic in onAfterFetch so you can remove it from onRender. Even you can remove complete onRender callback method.


regards

Thank you! I didn't even realize there was an OnAfterFetch action on aggregates. Newbie here. Thank you so much!

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