I have a master detail order entry UI where I have used the option to create multiple sales orders without returning to the browser screen. It works well except in one my screens it is returning a message.
While I click on the OK button, I get the attached warning (attached file : warning save.PNG) as if i called cancell button instead. What could be the reason?
I didn’t see any error message and not sure which code would be helpful to share for diagnosis.
Here is the xml file code related to windowActions
Further update. I have a table for file upload in the same user interface. When upload a file, I don’t get that unsaved alert message. Therefore it seems to be the message is coming from file upload mechanism that I have used. But not sure what is causing this alert!
Here is my file upload code that i have put in postInit
After you press OK, all changed entities are sent to the middleware, and saved instances are returned to the screen and are set to the same datasources. It happens even right before closing the screen.
If you have any calculations in datasource listeners (like calculating an Order amount by OrderLines), they can be invoked because datasource listeners are fired.
These calculations can change the entities again comparing to the saved instances set in the datasources.
If you remove the line marked with (!), the calculation will change the instance because the scale of BigDecimal will differ from the scale of this attribute in the database. So a good practice when working with BigDecimal is to set it’s scale to the same value as defined for the database column.