My team is using Appian 19.2 and since they now have a!localVariables() as a replacement for load(0 and with(), we've been using it explicitly. However I noticed that if I have local variables that query data inside the local variables definition, it queries the data every time something changes inside the form.
Let's assume I have the following code snippet
a!localVariables(
local!id,local!data = rule!getMyData(id: local!id),
{...rest of code here...}
)
With the above code, the query gets triggered every time local!id changes without having to use the a!refreshVariable() function. This is basically the same behavior we had with with() function, but something I did not expect.
Now if I have the following:
a!localVariables(local!data = rule!getMyData(),
Now I'm just querying the database and pulling all the data since I don't need to query based on conditions. Is this also querying the database everytime something changes on the form. I can't tell since the data is the same every time and there is no indication as to when the data was last queried.
Where I'm going with this is, do I need to use the a!refreshVariable() function with queries to avoid the overhead of querying the database every time. The documentation for 19.2 mentions the refresh function in order to update variables, but it does not mention what happens to locals that don't have it. In that case, does it behave like a load() or a with(). Is there a way to tell?
Discussion posts and replies are publicly visible