Jump to content

Writing Rule to Meet Multiple Conditions


andym

Recommended Posts

I am trying to write a rule where the user must meet two or more conditions.

 

My goal: If an extension is entered on either of the first two contact numbers, the third number will not be returned because of the amount of space the designer allowed. If they do not have extensions on the first two numbers, the third number will be returned. (below, 'Label3 RULE' is the third number formatted & with appropriate label).

 

Below is one of several failed attempts which will hopefully portray my end goal:

 

if (Field("Extension 1")||(Field("Extension 2")!="");
return "";
//else
return Rule("Label3 RULE");

 

Should I be taking a different approach to achieving a specific return where multiple conditions must be met?

 

Thank you,

 

Andy

Link to comment
Share on other sites

The problem is the semicolon at the end of the first line:

if (Field("Extension 1")||(Field("Extension 2")!="")[color=Red];[/color]

That effectively provides an empty statement block for the "if" statement. So it has no effect, and the following line (which returns an empty string) is always executed, unconditionally.

 

Remove that semicolon at the end of the first line and your rule will work fine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...