Wanted to make the webQuerySave even a little more generic and move the stuff
that changes to a field on the form.
so...
1. added a field called "IsRequired" on the form (you could have a few of
these).
2. Added a while loop to test against contents of this field.
Code follows:
errors:="";
n := 1;
@While( n <= @Elements(IsRequired);
@If( IsRequired[n]="" ; errors:=errors:("One of the Required fields is Empty");
"" );
@If( @Length(IsRequired[n])>1000 ; errors:=errors:"One of the Required fields
is too long"; "" );
n := n + 1);
Got a little longer chance to play with this.
Wanted to make the webQuerySave even a little more generic and move the stuff that changes to a field on the form.
so... 1. added a field called "IsRequired" on the form (you could have a few of these). 2. Added a while loop to test against contents of this field.
Code follows:
errors:=""; n := 1; @While( n <= @Elements(IsRequired); @If( IsRequired[n]="" ; errors:=errors:("One of the Required fields is Empty"); "" ); @If( @Length(IsRequired[n])>1000 ; errors:=errors:"One of the Required fields is too long"; "" ); n := n + 1);
@If(@Elements(errors)>0; @Do(@SetField("hasErrors"; 1); @SetField("Errors"; errors); @SetField("SaveOptions"; "0")); @Do(@SetField("hasErrors"; 0); @SetField("Errors"; ""); @SetField("SaveOptions"; "1")) );