Hello,
I have a form where some of the inputs are tied to a local variable so that I can perform some calculations with it. After submitting the form the values are saved as I assigned the value of the local variable to the attribute itself. However, when going back to edit the form, those inputs that are tied to a local variable shows up as empty, understandably as they are local variables then exist in the screen only. Is there a way where I can continue to use local variables for the variable in the input but at the same time get the value when I edit the form again? Thank you!
Hi,
If those values are exactly the same as what you save into a database field, I would say, don't do the extra work but just bind the aggregate result field to the variable.
If for some reason you can't, you'll have to add an OnAfterFetch event to the aggregate or dataAction, and use an Assign in there for your local variable.
Dorine
Hello Dorine,
Thank you for your help, I did indeed do extra work and made something that is simple complicated.
If you want to make the values persistent even after the user logged out. Then you have to bind the inputs to the aggregate.
Hello Low,
You can use client variables to store data until the user session ends. This will help you to store values in variable while navigating between screens
Thank you for your suggestion! But for client variable, when the users log out and then log back in, the value will be gone too right? So it wont be a good user experience
I managed to solved this issue, thank you for your help on this!
Hi Low,
To say it short Client variables are to the front end (browser) what session variables are to the server.
You cannot access session variables directly in screen actions or client actions of reactive web applications.
You would need to write a server action and use that in a Data action on your screen.
Client variables are stored in locally in the browser.
Regards,
Dhivyaraj Sivam
Thank you for your suggestion!
You need to bind local variable values to the aggregate. It will make your work much easier.
For better solution if you share sample oml that would be great to have a look.
Thanks.