Ask and answer questions about WebRatio, WebML and BPMN

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

asked 26 Jan, 10:09

lionel's gravatar image

lionel
0111
accept rate: 0%


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.

link

answered 30 Jan, 12:11

mariobrunowr's gravatar image

mariobrunowr
2553
accept rate: 43%

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 !?

link

answered 01 Feb, 09:24

lionel's gravatar image

lionel
0111
accept rate: 0%

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:

  • If a field is mandatory you have to add a Mandatory Validation Rule to this field.
  • If the value of a field must be greater than another value you can add a Compare Validation Rule.

For more details about the validation Rules you can refer to this article of our wiki: The Validation Rule Framework

link

answered 09 Feb, 09:39

albertomolinaroli's gravatar image

albertomolin...
63424
accept rate: 62%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×4
×2
×1
×1
×1

Asked: 26 Jan, 10:09

Seen: 314 times

Last updated: 09 Feb, 09:39

©2001-2011 Web Models s.r.l. All rights reserved