2

I am trying to create a Validation rule which will stop closing the case when either the Case Type or Subtype is blank. The formula which I have written -

AND(
  OR(ISBLANK(TEXT(Type__c)),
       ISBLANK(TEXT(Case_Subtype__c))
  ),
  ISCHANGED( Status ),
  OR( ISPICKVAL(Status,"Cancelled"),
        ISPICKVAL(Status,"Completed"),
        ISPICKVAL(Status,"Not Resolved"),
        ISPICKVAL(Status,"Annulé€"),
        ISPICKVAL(Status,"Terminé(e)"), 
        ISPICKVAL(Status,"Non résolu(e)")
  )
)

With this one, Validation rule is working fine for English Users, but when a French user is trying to close the case by selecting any of the above Status, Validation rule is not working i.e. case is getting closed without providing Case Type and Subtype?

Translated Values for Case Status PickList values in French Language enter image description here

Translated Values for Case Status PickList values in English Language enter image description here

2
  • 1
    Validation rules (and Apex Code) always use the Master Label values, not translated values. I'll need to do some research, but you might consider using the more direct ISPICKVAL(Type__c,"") instead of converting it via TEXT.
    – sfdcfox
    Commented Dec 2, 2016 at 17:41
  • @sfdcfox Let me store the value in a variable and then go for string comparison. But your point makes sense to me. Thanks for letting me know. Commented Dec 2, 2016 at 17:56

1 Answer 1

-1

Solution will be, In Translation Workbench for English language Case Status Picklist, define the translated values (same as picklist values), the way you have defined for French language.

And use master label and NOT the translated value in your validation.

AND(
  OR(ISBLANK(TEXT(Type__c)),
       ISBLANK(TEXT(Case_Subtype__c))
  ),
  ISCHANGED( Status ),
  OR( ISPICKVAL(Status,"Cancelled"),
        ISPICKVAL(Status,"Completed"),
        ISPICKVAL(Status,"Not Resolved")        
  )
)

For the sake of proof of concept I have done this and it is working as expected.

Condition for validation rule provided:

If Case status is completed, then Priority should be mandatory

AND( 
   ISBLANK( TEXT(Priority) ) , 
   ISCHANGED( Status ), 
   OR( ISPICKVAL(Status,"Cancelled"), 
    ISPICKVAL(Status,"Completed") 
  ) 
)

Defined Case status in translation for English language as follows:

English Translation

Validation on Case is showing as follows:

Validation on case english

For French User, defined locale and language as follows:

French user

Defined the translation for French language:

French translation

Validation is perfectly working if Priority is blank when Status = Terminé

Validation on French

2
  • No this one is not working. Commented Dec 2, 2016 at 18:52
  • I have added the screenshot for English translation workbench as well. But still for French users it is not working. Commented Dec 2, 2016 at 19:12

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .