-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
6Questions
-
9Replies
How to allow for extensions with my phone number format validation rule?
Hi, this Validation Rule works for me. It ensures the format is the following: (xxx) xxx-xxxx.
AND(
NOT(ISBLANK(HomePhone)),
NOT(REGEX(HomePhone, "\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}"))
)
Question: How can I amend the rule to allow for phone extensions? If I wanted to keep the existing phone format requirement but allow for "Ext. xxxxx" only, what would I need to do in my Validation Rule? Thanks much
Mike
AND(
NOT(ISBLANK(HomePhone)),
NOT(REGEX(HomePhone, "\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}"))
)
Question: How can I amend the rule to allow for phone extensions? If I wanted to keep the existing phone format requirement but allow for "Ext. xxxxx" only, what would I need to do in my Validation Rule? Thanks much
Mike
- Michael Sabel 9
- February 12, 2020
- Like
- 0
- Continue reading or reply
Want to figure out why this Validation Rule for Preferred Phone worked on for Contacts but not Leads.
The rule should fire if at least one phone field is populated and it requires the user to select a Preferred Phone. It works on Contacts, but won't fire when a phone field is populated on Leads. I'd like to figure out why and find out what the correct formula is. Thanks.
AND(
OR(
ISNEW(),
ISCHANGED(tcf_Phone_Home__c),
ISCHANGED(MobilePhone),
ISCHANGED(tcf_Phone_Work__c)
),
NOT(ISBLANK(tcf_Phone_Home__c)),
NOT(ISBLANK(MobilePhone)),
NOT(ISBLANK(tcf_Phone_Work__c)),
NOT(ISCHANGED(npe01__Preferred_Phone__c)),
OR(
ISCHANGED(npe01__Preferred_Phone__c),
ISBLANK(TEXT(npe01__Preferred_Phone__c))
)
)
AND(
OR(
ISNEW(),
ISCHANGED(tcf_Phone_Home__c),
ISCHANGED(MobilePhone),
ISCHANGED(tcf_Phone_Work__c)
),
NOT(ISBLANK(tcf_Phone_Home__c)),
NOT(ISBLANK(MobilePhone)),
NOT(ISBLANK(tcf_Phone_Work__c)),
NOT(ISCHANGED(npe01__Preferred_Phone__c)),
OR(
ISCHANGED(npe01__Preferred_Phone__c),
ISBLANK(TEXT(npe01__Preferred_Phone__c))
)
)
- Michael Sabel 9
- February 10, 2020
- Like
- 0
- Continue reading or reply
How can I exclude a specific Record Type from a Validation Rule?
Here's the formula I am using for a Validation Rule to require a specific phone number format be entered (xxx) xxx-xxxx. This formula works for me.
AND(
NOT(ISBLANK(HomePhone)),
NOT(REGEX(HomePhone, "\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}"))
)
Is there anything I can add to the formula to prevent it from firing on a specific record type? Let's call it "Record Type A".
Thanks.
AND(
NOT(ISBLANK(HomePhone)),
NOT(REGEX(HomePhone, "\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}"))
)
Is there anything I can add to the formula to prevent it from firing on a specific record type? Let's call it "Record Type A".
Thanks.
- Michael Sabel 9
- February 05, 2020
- Like
- 0
- Continue reading or reply
Need to add to Formula in Process Builder (create a separate validation rule?) so user must select a "Preferred Phone" if f they have 2 or more phone numbers on Conctact record?
Hi,
I am using the below formulas in Process Builder.
Salesforce automatically updates "Preferred Phone" picklist depending on which phone number field has a number in it. So, if the MobilePhone is populated it updates the Preferred phone with Mobile. If the HomePhone is populated it updates the Preferred phone with Home. If the WorkPhone is populated it update the Preferred Phone with Work.
1. Detect Change in Phone Field: Criteria Formula
OR(AND(ISNEW(),OR(NOT(ISBLANK([Contact].HomePhone)), NOT(ISBLANK([Contact].MobilePhone)), NOT(ISBLANK([Contact].npe01__WorkPhone__c)))),
ISCHANGED([Contact].HomePhone),
ISCHANGED([Contact].MobilePhone),
ISCHANGED([Contact].npe01__WorkPhone__c))
2. Set Preferred Phone Field: Immediate Action
CASE(
IF(ISBLANK([Contact].MobilePhone), '0', '1') +
IF(ISBLANK([Contact].HomePhone), '0', '1') +
IF(ISBLANK([Contact].npe01__WorkPhone__c), '0', '1'),
'100', 'Mobile',
'010', 'Home',
'001', 'Work',
NULL
)
This works great. The problem I now need to resolved is that if two or more phones are populated the user is required to select which is the Preferred Phone.
Thanks.
I am using the below formulas in Process Builder.
Salesforce automatically updates "Preferred Phone" picklist depending on which phone number field has a number in it. So, if the MobilePhone is populated it updates the Preferred phone with Mobile. If the HomePhone is populated it updates the Preferred phone with Home. If the WorkPhone is populated it update the Preferred Phone with Work.
1. Detect Change in Phone Field: Criteria Formula
OR(AND(ISNEW(),OR(NOT(ISBLANK([Contact].HomePhone)), NOT(ISBLANK([Contact].MobilePhone)), NOT(ISBLANK([Contact].npe01__WorkPhone__c)))),
ISCHANGED([Contact].HomePhone),
ISCHANGED([Contact].MobilePhone),
ISCHANGED([Contact].npe01__WorkPhone__c))
2. Set Preferred Phone Field: Immediate Action
CASE(
IF(ISBLANK([Contact].MobilePhone), '0', '1') +
IF(ISBLANK([Contact].HomePhone), '0', '1') +
IF(ISBLANK([Contact].npe01__WorkPhone__c), '0', '1'),
'100', 'Mobile',
'010', 'Home',
'001', 'Work',
NULL
)
This works great. The problem I now need to resolved is that if two or more phones are populated the user is required to select which is the Preferred Phone.
Thanks.
- Michael Sabel 9
- February 05, 2020
- Like
- 0
- Continue reading or reply
Trying to get validation rule right that excludes commas and periods from street address fields
So, I want to make sure that user can't type "St." for Street and must type "St" instead. And, that user can't type "Suite, 4" and must type "Suite 4".
So, no commas "," or periods ".".
Here's what I've tried. Not working because I think what I've done here is allow for commas and periods when I'm trying to exclude them. Not sure how to exclude them.
AND(
NOT(ISBLANK(MailingStreet)),
NOT(REGEX( MailingStreet, "[a-zA-Z0-9\\.\\,]+"))
)
Thanks.
So, no commas "," or periods ".".
Here's what I've tried. Not working because I think what I've done here is allow for commas and periods when I'm trying to exclude them. Not sure how to exclude them.
AND(
NOT(ISBLANK(MailingStreet)),
NOT(REGEX( MailingStreet, "[a-zA-Z0-9\\.\\,]+"))
)
Thanks.
- Michael Sabel 9
- February 04, 2020
- Like
- 0
- Continue reading or reply
How to get Regex phone number validation rule to work?
Hi, I'm using this validation rule to ensure users type in phone numbers in this format (xxx) xxx-xxxx:
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
I found this specific vr in Salesforce Help.
This is for Contacts.
Problem I'm having: The validation rule is firing even when the number is inputted in the right format. I tried it in production, developer account and sandbox and it is still doing the same thing.
Thanks.
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
I found this specific vr in Salesforce Help.
This is for Contacts.
Problem I'm having: The validation rule is firing even when the number is inputted in the right format. I tried it in production, developer account and sandbox and it is still doing the same thing.
Thanks.
- Michael Sabel 9
- January 30, 2020
- Like
- 0
- Continue reading or reply
How can I exclude a specific Record Type from a Validation Rule?
Here's the formula I am using for a Validation Rule to require a specific phone number format be entered (xxx) xxx-xxxx. This formula works for me.
AND(
NOT(ISBLANK(HomePhone)),
NOT(REGEX(HomePhone, "\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}"))
)
Is there anything I can add to the formula to prevent it from firing on a specific record type? Let's call it "Record Type A".
Thanks.
AND(
NOT(ISBLANK(HomePhone)),
NOT(REGEX(HomePhone, "\\([0-9]{3}\\) [0-9]{3}-[0-9]{4}"))
)
Is there anything I can add to the formula to prevent it from firing on a specific record type? Let's call it "Record Type A".
Thanks.
- Michael Sabel 9
- February 05, 2020
- Like
- 0
- Continue reading or reply
Trying to get validation rule right that excludes commas and periods from street address fields
So, I want to make sure that user can't type "St." for Street and must type "St" instead. And, that user can't type "Suite, 4" and must type "Suite 4".
So, no commas "," or periods ".".
Here's what I've tried. Not working because I think what I've done here is allow for commas and periods when I'm trying to exclude them. Not sure how to exclude them.
AND(
NOT(ISBLANK(MailingStreet)),
NOT(REGEX( MailingStreet, "[a-zA-Z0-9\\.\\,]+"))
)
Thanks.
So, no commas "," or periods ".".
Here's what I've tried. Not working because I think what I've done here is allow for commas and periods when I'm trying to exclude them. Not sure how to exclude them.
AND(
NOT(ISBLANK(MailingStreet)),
NOT(REGEX( MailingStreet, "[a-zA-Z0-9\\.\\,]+"))
)
Thanks.
- Michael Sabel 9
- February 04, 2020
- Like
- 0
- Continue reading or reply
How to get Regex phone number validation rule to work?
Hi, I'm using this validation rule to ensure users type in phone numbers in this format (xxx) xxx-xxxx:
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
I found this specific vr in Salesforce Help.
This is for Contacts.
Problem I'm having: The validation rule is firing even when the number is inputted in the right format. I tried it in production, developer account and sandbox and it is still doing the same thing.
Thanks.
NOT(REGEX(Phone, "\\D*?(\\d\\D*?){10}"))
I found this specific vr in Salesforce Help.
This is for Contacts.
Problem I'm having: The validation rule is firing even when the number is inputted in the right format. I tried it in production, developer account and sandbox and it is still doing the same thing.
Thanks.
- Michael Sabel 9
- January 30, 2020
- Like
- 0
- Continue reading or reply