Can we have multiple values in Custom Labels.
Yes, Salesforce supports multiple values in custom
Labels.
How to implement that ?
Create a New custom
label and provide Multiple values with comma ( , ) separated.
Example:
Custom Label Name:
School
Values:
Test,Exam,Tutions
How to access this Custom Label in Apex controller /
Class file
Syntax:
System.Lable.CustomLabelName
Example:System.Label.School
How to access this Custom Label in Visualforce page
Syntax:
!$Label.CustomLabelName
Example:
!$Label.School
How do we check if TempString is present in
the custom label in a controller ?
Syntax:
System.Label.CustomLabelName.Contains(value)
Example:
System.Label.School.contains(TempString)
How do we check if TempString is present in
the custom label in a visualforcepage?
Syntax:
CONTAINS($Label.CustomLabelName,TextValue)
Example:
CONTAINS($Label.School,"Text")
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. Custom food labels
ReplyDeleteThank you.
Deletesuppose My tempstring is Exam xyz then this statement System.Label.School.contains(TempString) excute or give error
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDelete