ASSOCIATE-REACTIVE-DEVELOPER practice question 3 of 35
Which event is needed if we do some logic over the result such as checking if it is empty?
Full set: 262 questionsThe After Fetch event is a specific handler for Aggregates and Data Actions that executes immediately after the data fetch successfully completes. This is the designated and most efficient place to implement logic that processes the fetched data, such as checking if the returned list is empty, manipulating the data, or assigning results to other variables. Using this event ensures the logic only runs when new data is available and ready for inspection.
A. Ready: The OnReady event runs only once when a Screen or Block is initialized. It is used for initial setup, not for processing the results of a data fetch which happens asynchronously.
B. Render: The OnRender event runs after every time a Screen or Block is rendered or re-rendered. Placing data processing logic here is incorrect and inefficient as it would execute on every UI update.
C. Destroy: The OnDestroy event is for cleanup logic and runs just before a Screen or Block is removed from the DOM. It is not suitable for processing fetched data.
1. OutSystems Documentation - Fetch data on a Screen: In the section "Process the results of a fetch," it states, "To process the results from an Aggregate or a Data Action, select the fetch in the Screen and add the On After Fetch event handler... The logic in the On After Fetch event runs after the data fetch." This directly supports using After Fetch to check results.
Source: OutSystems. (n.d.). Fetch data on a Screen. OutSystems Documentation. Retrieved from https://success.outsystems.com/documentation/11/developinganapplication/designui/logic/fetchdataonascreen/
2. OutSystems Documentation - Screen and Block Lifecycle Events: This document describes the purpose of OnReady, OnRender, and OnDestroy events. It clarifies that OnReady is for initialization, OnRender for DOM updates post-render, and OnDestroy for cleanup, none of which are intended for processing data fetch results.
Source: OutSystems. (n.d.). Screen and Block Lifecycle Events. OutSystems Documentation. Retrieved from https://success.outsystems.com/documentation/11/developinganapplication/designui/screens/screenandblocklifecycleevents/
3. OutSystems Documentation - Data Action: This page explains that a Data Action has an OnAfterFetch event property. This event handler is "executed after the Data Action's fetch is completed," confirming its role in post-fetch processing.
Source: OutSystems. (n.d.). Data Action. OutSystems Documentation. Retrieved from https://success.outsystems.com/documentation/11/reference/servicestudioreference/logic/dataactions/
Keep practicing
Take the free ASSOCIATE-REACTIVE-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ASSOCIATE-REACTIVE-DEVELOPER practice questions
- Question 1When the event is mandatory, a Block event such as the Client Action must be specified to…
- Question 2Considering the Function property in Client Actions, which of the following options is co…
- Question 4The SQL Query only allows executing SELECT statements
- Question 5The order of the Entities in the join does not matter.
- Question 6The list of values displayed on the Combo Box widget can be a combination of Entity and S…
- Question 7Entity Identifiers can be simple primary keys or composite keys
