You need to sign in to do that
Don't have an account?
Gwirizanani Sinoia
Compare Field value to a list of words
Hi all,
I was wondering if someone cloud help me figure this out.
I have a custom object called "OrganisationRoleName__c"
With the following text field called "RoleName__c"
Checkbox called ''Istrue__c"
I have a Static List of words ie
If a record is created and RoleName__c name substring is contained in the Static List set strue__c= true.
Hope this makes sense.
Thanks in advance.
I was wondering if someone cloud help me figure this out.
I have a custom object called "OrganisationRoleName__c"
With the following text field called "RoleName__c"
Checkbox called ''Istrue__c"
I have a Static List of words ie
- Hamptom
- Avenue
- Road
- Community
- New Hamport Place
- People Avenue
- Gregory Road
- Developer Community
If a record is created and RoleName__c name substring is contained in the Static List set strue__c= true.
Hope this makes sense.
Thanks in advance.
If i understand your requirment than below is your solution
for(String str : Static List) {
if(str.containsIgnoreCase(RoleName__c)){
strue__c= true;
}
}
Thanks for your response.
I think you misunderstood the requirement : the check should be the RoleName__c value (or subvalue ) needs to match Static List. For example if
RoleName__c value = "Developer Community": then the Static List value will be = "Community" as RoleName__c has Community in the name.
Hope this makes sense
Thanks again
if(RoleName__c.containsIgnoreCase(str)){
RoleName__c = str;
strue__c= true;
break;
}
}