Jimmyd Posted January 13, 2014 Posted January 13, 2014 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 Quote
Dan Korn Posted January 14, 2014 Posted January 14, 2014 (edited) 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 January 31, 2014 by Dan Korn call Rule instead of Field Quote
Jimmyd Posted January 31, 2014 Author Posted January 31, 2014 Dan, So sorry for not getting back with you on this. It works perfectly. I didn't know it would do that. Thanks so much for the tip. Quote
Recommended Posts
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.