You need to sign in to do that
Don't have an account?
Anirudh Sharma 5
Showing error when they select specific pick list value
I have a requirement where the field is pick list and I have two values in that YES and NO. So when they click yes a field should pop up which is done but when they click NO an error message should be shown to the user. Can you guys help me how to do that. And this is a VF page,
Thanks
Thanks
see below link
http://www.sfdcpoint.com/salesforce/show-error-message-visualforce-page/
There are lots of ways that you can acheive this in Visualforce from using a onchange [2], to a custom onChange action in your controller to a controller side error checking that rejects the save and adds an apex message [3] to alert the user.
NOTE: When adding code please use the "Add a code sample" button (icon <>) to increase readability and make it easier to reference.
[1] https://appexchange.salesforce.com/developers
[2] https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_selectList.htm
[3] https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_pages_message.htm