|
Hi, I have a PostgreSQL database who contain some contraints like not null, greater than etc... And when I use the Entry Unit and I let all empty fields, the insertion is possible because WebRatio replace the empty fields by empty string so the contraint not null are exceeded... It's possible to avoid the empty string in the Entry Unit ? Best regards. Lionel Ciao, Ho una database PostgreSQL che ha qualche costrizioni come il not null, piu grande che, ecc... Quando uso la Entry Unit e che lascio tutti i empty fields, l'inserimento e possibile perche WebRatio rimpiazza i empty fields con degli empty string, allora les costrizioni not null sono superati... Sarebbe possibile impedire gli empty string nell'Entry Unit? Grazie per la risposta. Lionel |
|
Hello Lionel, what I suggest you is to add Validation Rules on fields that must be mandatory. Then on the Create Unit you can set the property "Avoid blank records". If checked, the unit avoids the creation of blank records in the case all the provided inputs are Nulls or empty strings Ciao Lionel, quello che ti suggerisco è innanzitutto di aggiungere le Validation Rules di tipo mandatory sui campi che si ritengono obbligatori. Quindi sulla Create Unit potrai impostare anche la proprietà "Avoid blank records", la quale, se selezionata, evita la creazione di record vuoti nel caso tutti gli input forniti siano nulli o stringhe vuote. |
|
Thanks for your response, if it's okey for you, I will write in english it's more easy for me :) So, I tested the "Avoid Blank Records" property, and when I pressed the save button the first time, one blank record is inserted, but when I pressed the save button the second time, the error page is called and the insertion is blocked... It's very strange... Now I will try with the "Validation Rules" but for the fields who doesn't have constraints what should I do !? |
|
Hi, when you enable the "Avoid Blank Records" Property you can define the Attributes that you want to verify by setting the Blank Attributes Property. This feature is performed by the Create Unit, in this case when the form is submitted and the Create Unit is running. If you want to check the fields before the execution of the Create Unit, you can add the Validation Rules to the fileds. In this way you can validate the fields. For example:
For more details about the validation Rules you can refer to this article of our wiki:
The Validation Rule Framework |
