Screen shows incorrect value after refresh 

Screen shows incorrect value after refresh 


I am creating a ContractManagementApp and I'm puzzled because the screen shows values incorrect while the data is stored correct in de db. Moreover, the data is not always shown incorrect. To clarify I created some screenshots.

After creating a ContractVersion in a popupeditor this is the screen appearing:

Question1: how can create a refresh action for the top of the screen in the save action of the popupeditor?
After a manual refresh this happens:

It seems the value is shown incorrect, but is stored in the db correct:

The Contract (ContractId=5) seems to be shown on screen with correct versionnumbers, but the Contract (ContractId=6) is not.
Question2: Am I missing something or is it a bug?

I would really appreciate some help with this challenge.

Cheers,  Rienk Eisma
I did notice some "challenges"

1. You are not refreshing your showrecords, just the table
2. ContractversionShow is using the "current" of the tablerecords below. How do you know what the current may be?

Ok I believe I have to figure out how to use the OnNotify to refresh the upper part of the screen.

I dont really understand the Joosts' suggestions. In my view, the fact of the matter is that the row in the table is updated, otherwise it wouldnt show. After the manual refresh only the VersionNumber jumps to an incorrect value, the remaining values in the row are still correct, and are updated correctly in the (upper)show-table. The problem is only the VersionNumber. It seems to adopt a previous value but I don't understand why and how.

Moreover, when I create a new contractversion, the VersionNumber of the previous ContractVersion suddenly jumps to its correct value.


Rienk Eisma
Hi Rienk,

First problem I see in your eSpace is that the "AdvQuery1" do not have an "Order By" clause. So from the behavior you are having its giving you some wierd orders.

Another thing (like Joost said) is that on the second ShowRecords you use "GetContractversionsByContractId.List.Current", using .Current on elements that are not inside iterators (ForEach, TableRecords, ListRecords, ...) do not have a consistent behavior unless the list only has 1 element.

Also I don't understand the Assign in the preparation forcing the GetContractversionsByContractId.List.Current.CONTRACTVERSION.VersionNumber".
That is what is messing up the value on the bottom table after the refresh.

I think that to solve all the problems at once you should use only 1 ShowRecord and get all the information from the GetContractById query (Adding a join with the contract type and the respective Ordery by). Think this will also replace your advance query, since it will already have the latest ContractVersion.
Then on the refresh action, refresh both queries and the do a ajax refresh on the ShowRecord.

João Rosado
It works properly now.

I was under the impression I needed an advanced query and an assign to show the highest contractversion. It turns out I don't need it, it just shows the first row in the list so the order by desc is sufficient.

Thanks for the advice.


Rienk Eisma