Hi all,
I'd like to know after fetching the data, if I put an If widget with IsDataFetched is true on the widget tab, and I've got another OnAfterFetch event, which will update the date picker's date after the DataAction1 is fetched. I've found that sometimes I will get an error message with OutSystems is not defined mostly when I look up the browser in the incognito mode. I'd like to know how does this happen?
Hello Kay!The On After Fetch event is triggered after the aggregate/data action fetches the data from the respective data source(s), so at the very start of the OnAfterFetch event handler (action), in your case DataAction1OnAfterFetch, the IsFetched property from your DataAction1 should be = True.You can verify this by using the debugger and placing a breakpoint at the start node of you DataAction1OnAfterFetch action and checking the value of your DataAction1.IsDataFetched.Best regards,
José Rodrigues
Hi José,
Does it mean that when the value DataAction1.IsDataFetched returns true, the widget tab will start to render at the same time? Or the widget will start to render after the OnAfterFetch Event ends?
Thank you!
Hey KayThe OnAfterFetch event occurs when a Aggregate or Data Action has finished fetching data but before this data is rendered on the Screen or Block. You can check additional details here: https://success.outsystems.com/documentation/11/developing_an_application/implement_application_logic/screen_and_block_lifecycle_events/Best Regards,José Rodrigues
Hello Kay,
In OutSystems Reactive Web Applications, the IsDataFetched variable is used to determine if data has been fetched from a server action or a data source. The OnAfterFetch event is a server action event that is triggered after the data is fetched from a server action.
Here's the order in which they run:
Server Action Execution: When you call a server action that retrieves data, it will run first. During this server action execution, the data is fetched from the server or data source.
OnAfterFetch Event: After the server action has executed and the data is fetched, the OnAfterFetch event is triggered. This event is part of the screen lifecycle and allows you to perform actions or logic that need to be executed after the data is retrieved.
To summarize, the server action runs first to fetch the data, and then the OnAfterFetch event is triggered, allowing you to perform additional actions based on the fetched data.
regards
Hi Vikas,
I'd like to know when the DataAction is fetched successfully, the widget will start to render right away or run the OnAfterFetch Event first then render the widget on the screen.
Hi @Kay Smith Kindly check out this post.https://www.outsystems.com/forums/discussion/76267/outsystems-is-not-defined/
Hello kay,
The "OutSystems is not defined" error could be due to the way the platform handles client-side and server-side events, as well as the loading sequence of scripts in the browser.
Using the "If" widget with "IsDataFetched is true" condition checks client-side, relying on JavaScript execution.
The "OnAfterFetch" event is server-side and occurs after data is fetched. It may update the date picker.
The error suggests an issue with script loading, common in incognito mode or strict security settings.
So,Debugging and testing are necessary to pinpoint the exact problem.
Regards
Reemali.
Hi Reemali,
Is there a way to check the sequence of script loading? I'd like to know when the OutSystems.js loads in the OnAfterFetch Event. It seems that every time I open the browser, sometimes the script is loaded, but sometimes is not.