A12 2024.06 ext5
I modeled a button “save preliminary” with no validation in a form. But if there is an active error, the button does not work. So the form is not saved. I need a possibility to save a form even if there are active error messages.
A12 2024.06 ext5
I modeled a button “save preliminary” with no validation in a form. But if there is an active error, the button does not work. So the form is not saved. I need a possibility to save a form even if there are active error messages.
Hi @clara-fleet-yew, I tested this using your version of the SME with a modified basic workspace (Person_DM: active validation rule on FirstName and LastName, both fields shall be filled; Person_FM: save button with no validation) in the PAC 7.4.0. An Error was provoked by only inserting the last name. As you can see in the screenshot the request is submitted properly.
The error banner
“JSON-RPC Request failed and rollback was performed Document is not valid: [Entity: /People[1]/FirstName[1] Type: OMISSION_ERROR Message: all fields must be filled ErrorCode: Error rule_74a51 Rule: /People/NamesFilled]”
and the response from the server
indicates, that I am not allowed to save invalid models, even if no validation is requested from the respective action (in this case the save button with no validation). This is the expected behavior in the PAC but might be different in your project. Do you get the same responses after trying to submit an invalid form in your PAC?
From modelling perspective everything works as expected. Additionally, in the form model preview the same submission is successful.
Hi @paul-tall-kernel, thanks for the reply. I guess, that it then works as intended from A12. How did you then allow in the SME to still save the changes even if there are error messages? Because sometimes, it is wished to save invalid data. In our case, the customer should be able to save the form with a too high insured sum, so that the internal employee can open it and approve it.
Hi @clara-fleet-yew,
just to clarify, at this point A12 does not save the form, it submits the form to the server (which then refuses to save it). At this point the modelling is done right, only a developer might adjust the configuration of the data services (in a way that it also does not validate when a button requires no validation).
A workaround for you as a modeler would be the following:
1. Model the document model with the respective field, e.g. insured sum
2. Model the validation, that the error fires when the sum is higher than a certain number e.g. 10
3. Set the level at Warning or Info
4. Include details of further handling in the error message (which is now a warning/info)
5. Keep your button in the form model with no validation
6. Error fires and a Warning is displayed, the user can decide whether to keep submitting or not
7. Submission to the server is successful