[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1725
  • Last Modified:

Salesforce.com validation alerts/rules

In salesforce, is it possible to do these things:

1. On the Contacts screen, make an entire section appear only if a certain option is selected in a dropdown in another section?

2. If the above is not possible, is it possible to have certain form fields become unavailable (greyed-out?) depending on the selections in other fields?

3. Display an alert upon save indicating that certain fields are not completed )Ex: You have not completed the field Email Adress. Do you want to continue? Yes/No

I would like to know if I can do this, and, if possible, how? Thanks very much!

Andrey
0
andreyman3d2k
Asked:
andreyman3d2k
  • 4
  • 4
1 Solution
 
pauldesatadvologixdotcomCommented:
1. Yes, but not easily. You would have to write custom visual force pages and replace your standard contact form with your custom Contact visual force page. You would need someone with development experience to do this.

2. Yes... as long as the two fields in the dependency are both picklists. Under setup > Customize > Contacts > Fields, under Contact Custom Fields & Relationships click on Field Dependencies. Here you can set up the controlling and dependent pick list fields and configure what dependent field values are available based on the value selected in the controlling field

3. Under setup > Customize > Contacts > Validation Rules, you can use Salesforce formulas to evaluate TRUE conditions, and based on if the formula is TRUE when the user saves a record, display a message on the screen.

For example  if you had FieldOne and FieldTwo , assuming these were both text fields, and IF FieldTwo is required if FieldOne is not empty, you could set a rule such as:

AND(FieldOne<>"",FieldTwo="")

if this evaluated to TRUE on Save, you would display "You Must Complete FieldTwo To Continue".

After doing this, remember to set the Active checkbox on the Validation rule to begin enforcing the rule.
0
 
andreyman3d2kAuthor Commented:
Thanks very much for the reply. A clarification:

AND(FieldOne<>"",FieldTwo="")

if this evaluated to TRUE on Save, you would display "You Must Complete FieldTwo To Continue".

How would I do this last part? Ie how would I link the formula result to the save event?
0
 
pauldesatadvologixdotcomCommented:
It happens automatically. After you create a validation rule formula, enter the message to display when you are creating the rule, mark it active and Save, it becomes automatically enabled.

Fill in the fields as shown in blue on the validation rule
http://screencast.com/t/NWM5Mzhh:
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
andreyman3d2kAuthor Commented:
I see -- is there a way to have it give a warning, not a hard stop? So they will have the option to continue with those fields left blank.
0
 
pauldesatadvologixdotcomCommented:
No, but you could have a picklist value in your dependent field called "Not Applicable" or something like that which works for you.
0
 
andreyman3d2kAuthor Commented:
Not sure what you mean by the last comment. Basically the issue is this, people constantly forget to fill in certain fields, even when they have the info, so my goal is to pop up a reminder window to them if they try to save with those fields empty, saying something to the effect of "You did not enter the following fields: [field1], [field2] Would you like to go back and fill these out or continue with the save?"  And they have the option to hit Continue or Go Back, or Ok/cancel whatever it is. In other words, I want to be able to save the info if they just happen not to have an email address of a contact, but I want them to be reminded that it is blank in case they have it, but forgot to put it in.
0
 
pauldesatadvologixdotcomCommented:
That kind of functionality would lead you back to the answer for #1 I'm afraid. Custom Contact form created by a person who could develop Salesforce solutions for you.

In my experience, Salesforce ends up being a bunch of creative work arounds to avoid having to do programming work. You just have to think of a different way to accomplish what you want using the tools and skills you have.

For example, again this is not the perfect solution, but you could add a checkbox field called "Bypass Data Requirements", then in your validation rule add to your AND formula such that IF the user has checked the box, he gets to avoid the hard stop. Something like......

AND( OR(phone="",mobile="",email=""),Bypass=false) )

which is saying if phone, email or mobile aren't completed and you haven't checked the Bypass Data box then show the validation rule error message.
0
 
andreyman3d2kAuthor Commented:
Genius! Thanks for this idea, and all your answers and tremendous help!
0

Featured Post

Independent Software Vendors: 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!

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