So with a lack of real life problems to deal with on my dev org, I went and created a hypothetical then solved it.
Problem: I want a custom field on the accounts page for Vehicle. This should be a Picklist with the most common vehicle manufacturers and the last option being "Other." Below this should be a Text box to be used ONLY if the Picklist has chosen the "Other" option.
Solution: I start by going to Setup - Customize - Accounts - Add a custom field.
From here I choose New - Picklist and then I name it "Vehicle." I add in the Picklist options, go over who can view it and save the field.
I do the same thing to add another field but this time choose New - Text and name it "Other." I give this field a max length of 80 (a length is required).
A quick click over to the Accounts tab and edit one of the dummy accounts that the dev org came loaded with. Yes, there it is. A nice Picklist with the Other box nested just below it.
Everything looks great but there is a problem. Without any validation someone could select an option from the Picklist AND enter text in the text box. We want the text box to ONLY be used if the Picklist option is "Other." We need a Validation Rule!
Validation: Go to Setup - Customize - Accounts - Validation Rules - New
From here name your rule. I used OtherVal.
Now is the tricky part. Explaining what you want it to check for using the Formula Operators that Salesforce can understand. A long look at the link below and some serious googling helped me to build what I need.
https://na15.salesforce.com/help/doc/en/customize_functions.htm
In the box labeled Error Condition Formula I put this:
( ispickval(Vehicle__c, "Other") && isblank(Other__c) ||not(ispickval(Vehicle__c, "Other")) && not(isblank(Other__c)))
Click on the "Check Syntax" button and it will take a look at the formula to make sure your not missing something like a ")" which I always seem to be. Now enter an error message to display and save the rule.
Go check it out again by editing an existing Account and try to do something wrong. It should stop you and display your error message when you go to save the record.
It may not sound like a whole lot but this was a huge step. I'll keep you guys posted as things progress!
Problem: I want a custom field on the accounts page for Vehicle. This should be a Picklist with the most common vehicle manufacturers and the last option being "Other." Below this should be a Text box to be used ONLY if the Picklist has chosen the "Other" option.
Solution: I start by going to Setup - Customize - Accounts - Add a custom field.
From here I choose New - Picklist and then I name it "Vehicle." I add in the Picklist options, go over who can view it and save the field.
I do the same thing to add another field but this time choose New - Text and name it "Other." I give this field a max length of 80 (a length is required).
A quick click over to the Accounts tab and edit one of the dummy accounts that the dev org came loaded with. Yes, there it is. A nice Picklist with the Other box nested just below it.
Everything looks great but there is a problem. Without any validation someone could select an option from the Picklist AND enter text in the text box. We want the text box to ONLY be used if the Picklist option is "Other." We need a Validation Rule!
Validation: Go to Setup - Customize - Accounts - Validation Rules - New
From here name your rule. I used OtherVal.
Now is the tricky part. Explaining what you want it to check for using the Formula Operators that Salesforce can understand. A long look at the link below and some serious googling helped me to build what I need.
https://na15.salesforce.com/help/doc/en/customize_functions.htm
In the box labeled Error Condition Formula I put this:
( ispickval(Vehicle__c, "Other") && isblank(Other__c) ||not(ispickval(Vehicle__c, "Other")) && not(isblank(Other__c)))
Click on the "Check Syntax" button and it will take a look at the formula to make sure your not missing something like a ")" which I always seem to be. Now enter an error message to display and save the rule.
Go check it out again by editing an existing Account and try to do something wrong. It should stop you and display your error message when you go to save the record.
It may not sound like a whole lot but this was a huge step. I'll keep you guys posted as things progress!