Hi all,I have a Shared Action that should be prompting the webuser to make sure two other fields (DeliveredBy & DeliveredDate) are completed before saving the document. This is not working. The formula I used for this should be doing something but nothing happens and the document gets saved and the Status field gets updated also.
Can someone tell me why this is not working? Any assistance would be geatly appreciated.
Thanks,
Dan
I have included hereunder the formula for the share action button concerned:
text:=“delivered by”;
@If(
@IsMember(“[WarehouseMgt]” ; @UserRoles) & DeliveredBy =“” | DeliveredDate = “” ;
@Failure(“”); @Success);
FIELD Status := “Delivered and Completed”;
@Do(
@Command([FileSave]);
@Command([FileCloseWindow]))
Subject: Field validation not working
Your logic was if I’m a member of WarehouseMgt and DeliveryBy is Blank
OR DeliveryDate is Blank then Fail.
I doubt (maybe I’m wrong) this is what you meant, It would seem to me you would want to fail if you’re NOT a member of WarehouseMgt
OR DelieveryBy is blank
OR DelieveryDate is blank then Fail??
text:=“delivered by”;
@If(
@IsNotMember("[WarehouseMgt]" ; @UserRoles) | DeliveredBy ="" | DeliveredDate = "";
@Failure("<script>alert(\"You must select who this will be " + text + " and when\"); history.back() </script>");
@Success
);
Subject: Field validation not working
It looks like you need to add some parentheses to your test statement, i.e.,
@IsMember(“[WarehouseMgt]” ; @UserRoles) & ( DeliveredBy =“” | DeliveredDate = “” );
Also, do you only care if the date fields are completed for users with the WarehouseMgt role? The way it is written, anyone without that role will be able to save without any validation.
Subject: RE: Field validation not working
Thanks to both of you,
I just realized that the only thing that should be validated are the empty fields no matter if the end user is a member or not of the WarehouseMgt role.
I removed the @IsMember(“[WarehouseMgt]” ; @UserRoles) part of the formula and this should work now.
Much appreciated …TGIF,
Dan