Questions tagged [contains]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
31 views

'Attempt to de-reference a null object' with Field__c.contains()

When I use contains, I get Attempt to de-reference a null object: for(Gear__c g : gears{ if(toolsMap.get(g.Id).Status__c == 'Off' || toolsMap.get(g.Id).HelpText__c.contains('Hello there!')){ ...
0
votes
1answer
41 views

For loop conditional statement for if a List<Contact> contains an element

I have some code like this. While the conditionals I have are working fine what I cannot check for is if Contact lCon is NOT contained in the sfdcList. I have been trying to find a way to set up a Set ...
0
votes
1answer
24 views

IF(CONTAINS) question from an MPL

I am trying to aggregate data from an MPL into a separate field with fewer values. When I run the formulas, it is only returning the first value. Is there a way to rewrite the formula so that all true ...
6
votes
5answers
2k views

Is Apex Sometimes Case Sensitive?

I have a string set of field names populated as below: Set<String> setAllCustomSettingFields = new Set<String>(); Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe(); ...
-3
votes
1answer
87 views

Set contains (Filed name from Map<String, Schema.SObjectField> fieldMap ) not working

I have a below code to check the filed name inside the set to filed name inside the map. Map<String, Schema.SObjectField> fieldMap = Schema.SObjectType.Test__JobApp__c.fields.getMap(); set&...
3
votes
2answers
3k views

How to check if a string contains an element from a list

What is the best way to check if a string contains an element from a list? for example: String email= 'itairu@gmail.com' List<String> domainNames = split by ; from domains in a custom setting ...
1
vote
1answer
172 views

Set.contains() not working

My set contains custom JSON elements. When i try to use set.contains() method to check if the set has the JSON element it fails. MY JSON DATA: public uJSON(Id id,String name, Boolean manager,Id ...
1
vote
1answer
78 views

does apex class api version impacts new features

If my apex class API version is 28, will there be any issue if i try to use List class contains method ? I checked in debug logs, even if class has api version 28, i am able to use List contains ...
2
votes
3answers
1k views

CONTAINS() Formula

I have a checkbox formula that evaluates true if: Contains(Text_field__c, Account__r.lookup__r.Name) If i have "test account" in the account__r.lookup__r.Name, and "test account" in the ...
-1
votes
1answer
2k views

How to use CONTAINS in SOQl Query

My SOQL Query string str = '%'+email.subject.trim()+'%'; GMC__c gmcList = [select id,name,Case_Number__c from GMC__c where name like :str limit 1]; GMC__c Name is an autonumber field which ...
0
votes
1answer
379 views

list.contains in salesforce not working with wrapper class

My wrapper class is as follow: public class FilterWrapper implements Comparable { public String label {get; set;} public String value {get; set;} public Integer compareTo(...
3
votes
1answer
58 views

Database.Batchable List Record Id

I can't get this for loop to work: global void execute(Database.BatchableContext bc, List<Account> accounts){ List<Account> acctsToUpdate = new List<Account>(); List<...
0
votes
2answers
1k views

Method does not exist or incorrect signature?

I want to know if an Opportunity ID of a List is on another List and I get this error: Method does not exist or incorrect signature: [List<FAST_Opp__c>].contains(Id) public FAST__c ...
0
votes
1answer
34 views

Use Contains to compare a field value

I'm trying to use Contains to judge an email Subject for an Email Service I set up. Currently, I'm using == , but I want to use Contains because the subject might have characters after the text I'm ...
0
votes
1answer
46 views

How can I have two strings within an IF(CONTAINS( function?

If the text field contains both "A" and "B", then it should result in "AB". My formula: if(contains( Text_Field__c, "A" & "B" ), "AB", It goes through; there are no syntax errors. But it ...
3
votes
1answer
2k views

How to make use of formula function like “Contains” as case insensitive

I am Comparing a list of two strings in visualforce page using "Contains" function.But currently it retrieves only the exact match.Say,If the Name is Burlington it compares the name which contains "...
1
vote
2answers
5k views

soql contains on multiple values

I have accounts with billingcities. I have a query like below, select id , billingcity from account where billingcity like%atl% If i want to search on multiple cities, how can I do this? will comma ...
3
votes
1answer
2k views

Use CONTAINS in Visualforce Page Map

I have an apex:pageblocktable in VF Page with 2 columns. The 2nd column is displayed from a map. <apex:pageBlockTable value="{!noZips}" var="Zip"> <apex:column value="{!Zip.ZipCode}" ...