if(!ad.Street__c.contains('XXYYZZ'))
{
ForNewRecord.add(ad);
}
I have this piece of code in my class. Where XXYYZZ is a value which can be changed any time. I dont want to hard code in the Class. How can i use Custom Label here.
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.
Sign up to join this communityYou should add a null check, and use the System.Label
namespace:
ad.Street__c != null && ad.Street__c.contains(Label.XXYYZZ)
System
from System.Label
.