Composition field values changing upon editing

Hello all,

I’ve got a strange issue occurring where BigDecimal value fields in a composition change to zero upon editing the entry. I’m nearly positive this is happening due to my ineptitude in working with CUBA.

I’m auto calculating a ‘Total’ field from five other fields. It’s simple addition, and seems to work correctly, but when I edit an entry I just created, only the top field of the five is filled out and the other four are all set to zero. This seems to have to do with the values being uncommitted changes.

Here is the java code: (2.8 KB)

Thanks in advance for any help you can provide!

Since I haven’t gotten a response, I’m going to attempt to recreate the issue in a separate test project.

I’ve resolved this by excluding the additions individually if their value is null, instead of initializing the values to null. My fault.