Description of data:
A decimal field ({amount}) belonging to a Grid View Form is formatted as ‘read only’ in its general configuration (Label Field), or in editing fields it is marked as ‘read only’ (both options have been checked, separately).
In Application-> Navigation, the option has not been set: do not open a new record.
Practical case:
We calculate the value of the field {amount} in the ajax onChange event of another field, for example change {amount} and we do: {amount} = {price} * {amount}.
Initially the field {amount} APPEARS (it is visible), but when we press the Save Button, it will show the new line of the next record, and the field {amount} DISAPPEARS (it is no longer visible).
If we continue to insert records in none, it shows the field or fields that are as ‘read only’ and have been calculated.
To check if the field or fields have actually been saved, we reload the form and see that they have indeed been saved in DB, and they become visible again. Even if we update the line and save, they also become visible.
Momentary solution:
To solve this, I had to use the macro sc_field_readonly ({amount}, ‘on’) in the onLoadRecord event, and deactivate ‘read only’ (label field) in its general configuration, or in edit fields uncheck the check ‘only reading’.
In this way, when you press the Save button, the field remains visible and it will show the new line of the next record.
Conclusion:
In versions prior to 9.6.005 this did not happen, we did not have to use the macro sc_field_readonly (), it was enough to mark the field as ‘read only’.
Latest version checked with stable operation regarding this problem, 9.5.001, currently in production on our WEB.
Thank you
From V5 Professional Edition - Oct 28, 2011
Up to V9 Professional Edition - Jan 28, 2022