Questions tagged [contains]

The tag has no usage guidance.

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

How to evaluate multiple values in the Contains function via a declarative salesforce formula

I am trying check if the suppliedemail field contains any of these domains but is not working. If(CONTAINS("lincare.com:ndc-inc.com:preferredhomecare.com", SuppliedEmail), mod(...
0
votes
1answer
47 views

Validation Rule CONTAINS

Use Case: When a NEW Opportunity of a particular RecortType is created, AND the OpportunityOwner Country = 'United States' AND the OpportunityOwner Role has the word 'Sales Manager' THROW AN ERROR IF ...
0
votes
1answer
27 views

question about .Contains()

I have a quick question in regards to using .Contains(). I'm writing an if statement and need to update a text field if it contains "VA". However, if it contains "IVA" it shouldn't ...
1
vote
1answer
22 views

IF AND OR together in one formula

I want to write a formula for the following: Return Value A IF: Intake__c.Personal_Care__c contains 'toileting/bathing' OR Intake__c.Safety__c contains 'entering or exiting' AND Intake__c....
0
votes
1answer
40 views

How to check multiple occurrences in the child records?

I have a custom object called "Revence__c" with fields "profit1__c" and "profit2__c". Another custom object called "Product__c" is the parent of "...
0
votes
1answer
21 views

VisualForce - If Contains Or

I want to be able to render a form section if a picklist contains a certain value (value a) OR if it contains another value (value b). How do I write this correctly? Here is my currently working code ...
0
votes
0answers
21 views

VisualForce - If(CONTAINS) assistance in user form [duplicate]

I'm working with 'Contains' in VisualForce and have a user-fillable form. I want the user to be able to select an option from a picklist and then populate another pageblock section based on if the ...
0
votes
1answer
262 views

How to Blank Date value in Date formula field?

This field is to display the "date" value when this Opportunity's Stage value contains "Closed ". and at the same time Opportunity's Stage value not contains Closed means this ...
0
votes
3answers
97 views

How to find all records where a textfield contains “04/06/2020” twice? [duplicate]

this is a bit of an odd one. Say I need to find all Accounts where the textarea field "Notes__c" contains the text 04/06/2020 twice, how would I go about that? Ideally using Apex or Reports. ...
1
vote
0answers
25 views

Flow condition using CONTAINS doesn't work properly

I'm working on a flow, and basically I'm trying to compare number values with an "Array". when I debug d the flow, the condition fails: DECISION: verificarMesAProbar Skipped this outcome because its ...
0
votes
2answers
110 views

Checking if sequence of CHAR are in String

I am struggling with the below example. So basically I want to see if a contact is the Chief Operations Officer. Many of these individuals have the title "COO". So I am running into the following ...
1
vote
1answer
19 views

How do I remove repeating parts?

I'm trying to remove a substring with \n + random dateTime value + created date time.. My code works, but I want to make it prettier. How do I remove repeating parts by different conditions? If it's ...
0
votes
1answer
39 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
44 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
27 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 ...
7
votes
5answers
4k 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
294 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&...
4
votes
2answers
7k 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
739 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
111 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
2k 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 ...
-2
votes
1answer
6k 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 ...
1
vote
1answer
646 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
73 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
41 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
48 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 ...
4
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 "...
2
votes
2answers
7k 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
3k 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}" ...