You need to sign in to do that
Don't have an account?
raghavi SR
Fire validation when picklist is selected manually
I have 'lead status' picklist with values.
New
Working
converted
unqulaified
Out of these only unqualified can be selected manually. Others are automatic. When others are selected manually ,a validation must be thrown
I tried using who.name ,it throws error. what can be done?
Thanks in advance.
New
Working
converted
unqulaified
Out of these only unqualified can be selected manually. Others are automatic. When others are selected manually ,a validation must be thrown
I tried using who.name ,it throws error. what can be done?
Thanks in advance.
FYR
Regards
Rajesh
Thanks for the response .
The Above affects both manual entry and automatic entry like triggers or workflow!
My question is this can happen both manually and automatically. Restriction must be provided when picklist is chosen manually. Any solutions regarding that?
Better you can choose an trigger with the event before update.
Regards
Rajesh
There are two options I can think of to resolve this:
1. In case of you are using record type for lead, you can select only unqualified status value for that record type. so that user will have only unqualified to be selected manually, other values will not be shown to the user. Also you can set rest of status values in workflow, trigger and in apex. As we are only showing user unqualified status there is no need of validation.
2. Make New, Working, Converted values as inactive. So that user will not be able to select these values. The limitation for this below:
- You can not use inactive values in list views as well as reports in filters.
Hope this helps.
Regards,
Malhari.
HI there,
Validation Rule :
AND(!ByPass__C,!ISNEW(),(OR( ISPICKVAL(lead status, "new"), ISPICKVAL(lead status, "working"), ISPICKVAL(lead status, "converted") )))
For Lead Converting :
Please unchecked the Require Validation for Converted Leads checkbox in Lead Setting.
In trigger :
Introduce a dummy checkbox field that is not visible to anyone. And let the Validation Rule bypass the record if that checkbox is true. Now, in your trigger before you update oppsToUpdate, first update that dummyCheckbox to true. In this way, the validation rule will be bypassed. Also, make sure you make the checkbox false as soon as the trigger does its action. In order to do this, you can create a workflow or Process Bulider that will do the field update of that dummy checkbox to false whenever the value is true.
Please let me know if you would need any help on this.
Please mark my answer , If it's helpfull for you.
Thanks,
raghavi
It looks feasible except for
For Lead Converting :
Please uncheck the Require Validation for Converted Leads checkbox in Lead Setting.
we have other validations for lead!
Picklist fields can only be used in these functions:
Hi ragavi,
Then please use the custom validation(adderror) throught trigger code.
In your trigger before you update oppsToUpdate,set a custom add error with your conditions.
Thanks!..