I have just spent quite some time searching for a strange error in my app.
When i press a button i run two patch functions.
patch 1 updated table 1 data and patch 2 updated table 2 data.
table 1 and table 2 have an relationship.
in my app when i press a row in a gallery i do set "thisItem" to an variable.
set(varThisItem;gallery1.selected)
Then i navigate to a new screen
on this screen i have some textboxes, comboboxes that i populate using
varThisItem.column1 etc.
then to save the data from the textboxes and comboboxes i use patch to update some of the table1 columns.
the other patch function that update table2 do so just to create a new record and log that a change have been made by a user.
but for some reason som lookup columns is set to blank. i could not figure out why.
but i solved this by separating the code and first run the patch on table1 then i added a second button and auto-pressed it with select(button2) and then run the patch for table2.
i cant explain why i got it to work.
it feels like the code work to fast so the datasource does not have time to update.... by separating the code i guess i get some delay.
can this be true?
i have noticed that i do benefit from adding some timers and to delay the code sometimes.
but i can not figure out when i SHOULD use it and when i dont need to....
looking for some kind of explanation to better understand why i need so many controls in my apps just to have them hidden and run code from...