At present formula ISPICKVAL(picklist_field, text_literal) only allows plain text as text_literal (second parameter)
It would be very useful if it could support nested functions in addition to plain text.
Ex: ISPICKVAL(FIELD, Case(...))
Use case:
- User object has Country picklist which defines on which country this user is allowed to work
- Account also has picklist with same country list
- Upon Account save we need to validate whether or not user specified correct country
At the moment to check if User selected proper Country we have to write in Validation Rule something like this
===========================
CASE(account-field,
“USA”, “USA”,
“UK”, “UK”,
“France”, “France”,
… lots of other countries …
“”)
<>
CASE(user-field,
“USA”, “USA”,
“UK”, “UK”,
“France”, “France”,
… lots of other countries …
“”)
===========================
If ISPICKVAL(FIELD, Case(...)) was possible this formula would look twice shorter like:
===========================
ISPICKVAL(account-field, CASE(user-field,
“USA”, “USA”,
“UK”, “UK”,
“France”, “France”,
… lots of other countries …
“”))
===========================
1 Comment » Posted by gaiser
Posted Aug 27
Categories: Customization, Force.com Platform
|
adminisaurusrex Aug 27 |
A well stated argument. And I think I may have learned something too. |