• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 221
  • Last Modified:

@If question

I'm trying to create an action button in a form which will execute a specific action based upon the value of a field. I think I have a syntax problem, but I'm not sure.

The field that is referenced in @If is a radio button named "Verifier_Accept" with the following 2 possible values: "Accepted" and "Need More Info".

I want to toggle an @MailSend & @Prompt based upon what the value is,

For "Accepted":

@MailSend(Verifier_Assigned_To;"";""; Subject;"";"You have been assigned Why-Why # ":Why_Why_Number:" by " :  @Name([CN];Verifier_Names):"     A response is due on   ":Verifier_Due_Date:"    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]);
@Prompt([OK];"ELECTRONIC MESSAGE SENT";"Email has been sent to Assignee");
@If(@IsValid;
@Do(@Command([FileSave]); @Command([FileCloseWindow])); "")


FOR "Need More Info":

@MailSend(Initiator:Initiator_Other_Contacts:Initiator_Courtesy_Copies_To;"";""; Subject;"";"Why-Why # ":Why_Why_Number:"     More Information is requested by ":@Name([CN];Verifier_Names):"Info Requested":Verifier_Questions:"    Please view the comments / questions in the Why-Why Verification section for more details.   Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]);
@Prompt([OK];"ELECTRONIC MESSAGE SENT";"Email has been sent to Initiators requesting MORE INFO for this Why-Why");
@If(@IsValid;
@Do(@Command([FileSave]); @Command([FileCloseWindow])); "")


Can anyone help me with the syntax on this?
0
simpsop
Asked:
simpsop
  • 3
  • 2
1 Solution
 
ArunkumarCommented:
Did you try

@IF(Verifier_accept = "Accepted";
   @Do(First set of statements
       );
Verifier_accept = "Need More Info" ;
   @Do(Second set of statements
       );
@Success)

?
0
 
pratiganCommented:
ok.. first the form should be auto refresh fields or a UIDOC.Refresh before the button is used in order to refresh and validate the field values. @isValid is not necessary if you auto refresh fields as the refresh will take care of validating the formulas within the form.
@If(@IsValid;
@Do(@Command([FileSave]); @Command([FileCloseWindow])); "")
would just be:
@Command([FileSave]);
@Command([FileCloseWindow])


Subject is refering to a field on the form that contains values for this field .. correct.!?  When you string values together you need to use the + sign.  For instance in your example above.
@MailSend(Verifier_Assigned_To;"";""; Subject;"";"You have been assigned Why-Why # " + Why_Why_Number + " by " + @Name([CN];Verifier_Names)+ "     A response is due on   " + Verifier_Due_Date + "    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]);
  The List separators : work for field values inputted not actual text.
Try this....
0
 
simpsopAuthor Commented:
Thanks so far, looking better...

Here's what I wound up with.

It tells me "Function arguments were expected but none were supplied. The error highlights the parenthesis to the left of the  #######ERROR########  marked below



@IF(Verifier_accept = "Accepted";@Do(@MailSend(Verifier_Assigned_To;"";""; Subject;"";"You have been assigned Why-Why # " + Why_Why_Number + " by " + @Name([CN];Verifier_Names)+ "     A response is due on   " + Verifier_Due_Date + "    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]);)#######ERROR######## ;
Verifier_accept = "Need More Info" ;@Do(@MailSend(Originator + Initiator_Other_Contacts + Initiator_Courtesy_Copies_To;"";""; Subject;"";"Why-Why # " + Why_Why_Number + "     More Information is requested by "+ @Name([CN];Verifier_Names) + "   Info Requested  " + Verifier_Questions + "    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]););
@Success)
@Command([FileSave]);
@Command([FileCloseWindow])@IF(Verifier_accept = "Accepted";@Do(@MailSend(Verifier_Assigned_To;"";""; Subject;"";"You have been assigned Why-Why # " + Why_Why_Number + " by " + @Name([CN];Verifier_Names)+ "     A response is due on   " + Verifier_Due_Date + "    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]););
Verifier_accept = "Need More Info" ;@Do(@MailSend(Originator + Initiator_Other_Contacts + Initiator_Courtesy_Copies_To;"";""; Subject;"";"Why-Why # " + Why_Why_Number + "     More Information is requested by "+ @Name([CN];Verifier_Names) + "   Info Requested  " + Verifier_Questions + "    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]););
@Success)
@Command([FileSave]);
@Command([FileCloseWindow])
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
pratiganCommented:
first...you don't need both file saves...put them outside the Do statement.  also the error, I removed the ;  Try this.
@IF(Verifier_accept = "Accepted";@Do(
@MailSend(Verifier_Assigned_To;"";""; Subject;"";"You have been assigned Why-Why # " + Why_Why_Number + " by " + @Name([CN];Verifier_Names)+ "     A response is due on   " + Verifier_Due_Date + "    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]));
Verifier_accept = "Need More Info" ;@Do(@MailSend(Originator + Initiator_Other_Contacts + Initiator_Courtesy_Copies_To;"";""; Subject;"";"Why-Why # " + Why_Why_Number + "     More Information is requested by "+ @Name([CN];Verifier_Names) + "   Info Requested  " + Verifier_Questions + "    Link to Why-Why:       ";      [IncludeDoclink]:[PriorityHigh]));
@Success);
@Command([FileSave]);
@Command([FileCloseWindow])


0
 
simpsopAuthor Commented:
Thanks for the help.
0
 
pratiganCommented:
Your welcome !!
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now