views:

31

answers:

1

Hi, I have a user object which is using pfc services. Now, during update, I have written my validation code in the pfc_validation() function, and when validation does not succeed, I am returning -3 from that function. But still I am getting an error message saying - "A database error has occured.....", which means the update process is not aborting. I thought if I return -3 from the pfc_validation function, it will stop the further update process.

Now how can I cancel the rest of the pfc_save process if validation fails?

+2  A: 

If your datawindow inherits from pfc_u_dw, you will see there (in the ancestor's pfc_validation event) that:

-1 = validation failed

Make sure that you return the value that is defined as the failure value in the ancestor

gd047
Hi, can you tell me how can I make sure that a text field in datawindow is not empty?
Night Shade
That can't be answered in a comment. You should try to read that field in the pfc_updateprep event, and act accordingly.
gd047
ok, I am making it a standard question. Please explain it there...
Night Shade