You need to sign in to do that
Don't have an account?
nickfs92840
Validation Rule needed for Picklist + Field Type
I have an object where a pick list is setup, and when an item is selected from the pickiest, a % field is required to be filled in with a percentage.
The API's are:
Picklist = Local_Type__c % field = Rate_A__c % field = Rate_B__c
Here are some scenarios that may be made during the selection process:
Scenario 1
When Picklist "Local_Type__c" is selected and from the menu selections, "Type 1" is selected, % field "Rate_A__c%" is required.
Scenario 2
When Picklist "Local_Type__c" is selected and from the menu selections, "Type 2" is selected, % field "Rate_B__c" is required.
Scenario 3
When Picklist "Local_Type__c" is selected and from the menu selections, "Type 1 and Type 2" are selected, % fields "Rate_A__c" and "Rate_B__c" are required.
Please help in creating this validation rule for me. Many thanks!
Okay I'd recommend breaking this out into 3 separate VR's but basically you wanna do something like this:
All Answers
Is LocalType a Picklist or a MultiPicklist datatype?
Its a Local Type Field.
In Scenario 3, the picklist choice may be "Rate A % and Rate B %", as in it would be a single type selection and not two separate selections. Thank you Steve!
Hi Nick, that's not a datatype. The datatype is the "format" of the field (Text, Number, Date, Picklist, Multip Picklist, etc.)
ha!, ooops, Picklist....
Scenario 3 that you described is not possible with a Picklist field ->
Does the picklist have a single value for ""Type 1 and Type 2""
yes, "Type 1 and Type 2" would be a single selection.
Okay I'd recommend breaking this out into 3 separate VR's but basically you wanna do something like this:
Can you break it up into three different VR's for me? Thanks!!
Sure, that will cost you 3 times as many beers...
Nick, are you all set or do you still need help with this? (I'm getting thirsty!)
Hi Steve! I'm probably going to have about 20 items in the picklist. I used the first VR you provided and it worked well with the 3 selections.
Do you think I should have 20 different VRs? Let me know!
Hi Nick,
It's your call, but I personally like to break things out so it's easier to troubleshoot, but 20 VR's might be more trouble to manage than it's worth.
Either way, both examples you provided work perfectly! Thank you again!