Decision Activity Script - Dynamic Forms

Topics: Core
Jun 23, 2015 at 8:55 PM
Sipke,

I have been able to get most of the validations working except when I try to do something like the one below it does not work. It seems trying to do an AND operator is not working correctly. Do you see anything wrong with the syntax below? I have tried it with and without parenthesis around both statements. Any ideas?

if (("#{FormSubmission.Field:EskerFaxNumber}".Length > 0) && ("#{FormSubmission.Field:ForwardEskerFaxNumberTo}".Length <= 0 )) { SetOutcome("FAIL"); } else { SetOutcome("PASS"); }

Thank you,

RG
Jun 24, 2015 at 6:13 PM
Took me a bit, but I figured out the syntax on this as well.

Just for reference, below is the proper syntax for what I was trying to accomplish...

if ("#{FormSubmission.Field:EskerFaxNumber}".ToString().Length > 0 && "#{FormSubmission.Field:ForwardEskerFaxNumberTo}".ToString().Length <= 0) { SetOutcome("FAIL"); } else { SetOutcome("PASS"); }
Marked as answer by RG29 on 6/24/2015 at 10:13 AM
Developer
Jun 25, 2015 at 9:19 PM
That's interesting. Even though "#FormSubmission.Fields:EskerFaxNumber" is a string (whatever the token evaluates to, it is a string because of the enclosing quotes), you strill have to do a ToString (on a string constant)? Maybe some dynamic strangeness going on. Anyway, glad you sorted it.4423
Jul 3, 2015 at 5:42 AM
i can verified it.
at first time, i can use :
ContentItem.User.FirstName.Value="#{FormSubmission.Field:FirstName}";
ContentItem.User.LastName.Value="#{FormSubmission.Field:LastName}";

SetOutcome("Done");

but after import and export , i should use:

ContentItem.User.FirstName.Value="#{FormSubmission.Field:FirstName}".ToString();
ContentItem.User.LastName.Value="#{FormSubmission.Field:LastName}".ToString();
SetOutcome("Done");