Validation

Hi

What is wrong with this formula code?

The setfield doesnt work! dummy is editable text field!

@If(@Length(jmbg)!=13 & dummy !=1;

@Do

(

@Prompt([Ok];“Warning”;“Wrong JMBG”);

@SetField(dummy;1)

);

@Success)

Subject: RE: Validation

I don’t understand what is “the X window with the red tittle bar with the body value 1”.

If dummy is a text field, then it is a mistake to test dummy !=1. Instead, test dummy !=“1” and when you set it, set it to the value “1” not 1.

Bhasker is right that you need to put the field name in quotes when you use @SefField.

It looks like you are doing something here where, if the user edits an existing document which has a 13-digit number, and they change it to a different number which is not 13 digits, the system will not warn them because it already warned someone else who created that document initially, and then corrected their initial entry. Is that what you intended?

Subject: Validation

try this:

@SetField(“dummy”;“1”)

Regards,

Bhasker

Subject: RE: Validation

It still doesnt work!

It brings up the prompt window and then the X window with the red tittle bar with the body value 1!

Help

Subject: Validation

You shouldn’t have to in notes 6.53 but…At the start of the formula, try doing:

FIELD jmbg:=jmbg;

FIELD dummy:=dummy;

I won’t ask why you are using a validation formula to set a field…