0

Below is the validation rule

(TEXT(Full_Care_Confirmed__c)) == 'Yes'
&&
(
((ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care Equipment Domestic'))
||
ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care International')
||
ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care Demo Equipment Accept')
||
ISPICKVAL(CPQ_Order_Type__c,'Canada-Full Care Equipment')))

IF full care confirmed picklist field is set to YES then CPQ_Order_Type__c picklist value should be any of the above

2 Answers 2

0

Validation rules trigger an error when the result is TRUE. This means you need to invert the logic with the NOT operator.

ISPICKVAL(Full_Care_Confirmed__c,'Yes')
&& NOT(
ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care Equipment Domestic')    ||
ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care International')         ||
ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care Demo Equipment Accept') ||
ISPICKVAL(CPQ_Order_Type__c,'Canada-Full Care Equipment')
)
2
  • i have added and tested it but when we select any of the above value like Corporate-Full Care Equipment Domestic it is also throwing error.
    – goutham k
    Mar 5, 2019 at 10:20
  • Snippet which i have edited TEXT(SBQQ__Quote__r.CPQ_Subsidiary__c )== 'VTI NA' && $User.Avoid_Validation_Rules__c = false && ISPICKVAL(Full_Care_Confirmed__c,'Yes') && NOT( ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care Equipment Domestic') || ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care International') || ISPICKVAL(CPQ_Order_Type__c,'Corporate-Full Care Demo Equipment Accept') || ISPICKVAL(CPQ_Order_Type__c,'Canada-Full Care Equipment') )
    – goutham k
    Mar 5, 2019 at 10:20
0

You can not set the value of a field using Validation Rule. The purpose of validation rule is to show error when some condition matches. For your requirement , you will need to use Process Builder or Workflow rule

1
  • I am not setting the value here. I prompting user to check the value in pick list field value correctly.
    – goutham k
    Mar 5, 2019 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.