Computed value is auto reset unexpectedly in saved document when I select on any value in a screen

Hi, after we upgraded A12 version from 2023 to 2024.06-ext4, there is a strange behavior with the computed value in CDM Form
Client reset data
Some notes here:

  • All the reset data are computed values
  • The issue only happens if I click the button “Save & Next” from “Price Indication” screen, and does not happen if I navigate to the “Client” screen by the menu bar.

Do you have any suggestions on how to handle this case best?
Thank you.

Hi @van-open-birch

I don’t have an answer for you yet but I wanted to know that we are looking into this.

Having recieved your models, I can see that the “Save & Next” button uses custom code to save the partially validated document. I cannot reproduce this behavior in the Preview App as:

  1. The exact functionality of the custom action not clear to me.
  2. After filling the 3 Fields on “Price Indication” that you show on in the gif, the document is invalid (32 Error Messages).

I’m going to reduce the models and see if I can reproduce the behavior shown in the gif like this:

  • Create valid document with data in the first 3 Fields on “Price Indication”
  • Save this document
  • Re-open the document and follow thesteps shown for the “Client” screen

I’ll let you know as soon as I have more information.

Hi @van-open-birch,

My gut feeling says that this issue arises from the invalid state of the document when you create a relationship link.

As I mentioned in my previous post, your “Save & Next” button only partially validates the form. This means that the document may be, and in this case is, invalid.

My logic is based on your observation that the issue is only seen after clicking on “Save & Next”. It goes like this:

  1. Your Offer document is invalid
  2. You try to create a link from the invalid Offer document to a Client document
  3. Creating the link does not trigger any validation in the frontend so everything looks okay initially until…
  4. You change a field value which leads to a re-computation of all computed fields
  5. The computation fails and this leads to all computed fields being cleared.

The behavior that a computation failing leads to all computations being cleared is described in A12-16939. This requirement ticket was completed in 2025.06 so that only the the computation rules that reference invalid data will be cleared and not all of them.

So how can you test this? Is it possible for you to create a valid document and then go through the same steps. If this does not demonstrate the same issues, then that proves that either new or valid documents work. There should also be some error messages in the Kernel if the computations are failing due to invalid data. You could ask a developer to check for these.

If this is truly the problem, the solution would be to integrate state-machine like logic so that “Save and Next” sets a state for the document which you can integrate into your validation rules. There are examples of this type of modeling in the Workflows documentation, here.

FYI, I think that the link is still present as you can still see the “Type of Person” data. However the Binding Drop-down changes to --NO LABEL-- as this should display the result of the PartnerName computation, Computation_PartnerName.

Hi @malcolm-silver-ice ,

Sorry for late reply.
Unfortunately, it’s not the case. I removed all validation rules to make sure there is no any error when saving the document, but the issue is still there.
One thing that confuses me is that if I remove the computation of PartnerName, the issue will not happen in this field, but I can’t see any invalid point in the computation.

Hi @van-open-birch

Now it’s my turn to apologize for the late reply. Shout out to the discourse admins for reminding me :folded_hands:.

I’ve taken another look at the models and I still cannot reproduce your issue using the Preview App. I did the following:

  1. Created a reduced Contract Model
  2. Created valid test data with the field values shown in your video. This data is valid as it is based on the reduced model.
  3. Uploaded this to the Preview App database
  4. Uploaded the real models (the test data is now invalid).
  5. Tested linking the Client and answering a question.

Answering the question does not cause any issues.

However, there’s a lot of differences between your test and my test:

  • The Client Test Data
  • The saved Contract (it’s missing a lot of initial values and computed values)

I’m happy to test again using the test data that you have (the Client and saved Contract data that you show in the video). Currently, I don’t see an issue in the models but as I have already stated, the exact test data that you are using might lead to invalid data which blocks the computation rules. Without the exact test data, I cannot test these complex models further.

Hello @van-open-birch , I am a member of the Discourse team. I can see that there was a new response to your question on the Topic of the discussion. Is there anything else we can do?

Thanks ahead for your feedback and have a nice rest of the day!