Jump to content

Combine a Phone rule with a phone format rule


Jimmyd

Recommended Posts

I need to add a Phone format rule to an existing phone rule.

if (Field("Phone3")!="")

return Field("Phone2");

if (Field("Phone2")=="")

return Field("Phone1");

else return ("");

 

I need to add the formatting to this rule so that it comes out as:

(***) ***-***x for Phone 1

Link to comment
Share on other sites

Probably the easiest way to accomplish this is to create several (3?) different versions of the "Change phone format Rule" XML Template, each of which works on a different phone number field. You'll want to edit the name of each of these rules to reflect the corresponding phone number field it's using, such as "Phone 1 Format", "Phone 2 Format", etc. Then the rule you posted above can simply call out the XML Template rules instead of the fields, something like this:

if (Rule("Phone 3 Format")!="")
  return Rule("Phone 2 Format");
if (Rule("Rule2 Format")=="")
  return Rule("Phone 1 Format");
//else
  return ("");

Edited by Dan Korn
call Rule instead of Field
Link to comment
Share on other sites

  • 3 weeks later...

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...