Skip to main content
added 10 characters in body
Source Link
cropredy
  • 73.3k
  • 8
  • 128
  • 284

I have the below line that compares 2 text fields on a custom object to see if they contain specific values:

 if(Object.Notes__c != null && (Object.Notes__c.contains('Value1') || 
    Object.Notes__c.contains('Value2')))

However, now I want to change the statement to see if the text entered in the Notes__c field on my custom object contains any of the values set in CustomSetting1. How would i go about that?

I've tried the following, but I'm not sure if this is right or will give me all the values in my custom setting:

List<Keywords__c> custSet = Keywords__c.Getall().Values();
        string keyWords=custSet[0].Name;

for(Object__c Object : Trigger.New){
     if(Object.Notes__c != null && Object.Notes__c.contains(keyWords))...

I have the below line that compares 2 text fields on a custom object to see if they contain specific values:

 if(Object.Notes__c != null && (Object.Notes__c.contains('Value1') || Object.Notes__c.contains('Value2')))

However, now I want to change the statement to see if the text entered in the Notes__c field on my custom object contains any of the values set in CustomSetting1. How would i go about that?

I've tried the following, but I'm not sure if this is right or will give me all the values in my custom setting:

List<Keywords__c> custSet = Keywords__c.Getall().Values();
        string keyWords=custSet[0].Name;

for(Object__c Object : Trigger.New){
     if(Object.Notes__c != null && Object.Notes__c.contains(keyWords))...

I have the below line that compares 2 text fields on a custom object to see if they contain specific values:

 if(Object.Notes__c != null && (Object.Notes__c.contains('Value1') || 
    Object.Notes__c.contains('Value2')))

However, now I want to change the statement to see if the text entered in the Notes__c field on my custom object contains any of the values set in CustomSetting1. How would i go about that?

I've tried the following, but I'm not sure if this is right or will give me all the values in my custom setting:

List<Keywords__c> custSet = Keywords__c.Getall().Values();
        string keyWords=custSet[0].Name;

for(Object__c Object : Trigger.New){
     if(Object.Notes__c != null && Object.Notes__c.contains(keyWords))...
added 369 characters in body
Source Link
J. Neilan
  • 1.2k
  • 4
  • 23
  • 54

I have the below line that compares 2 text fields on a custom object to see if they contain specific values:

 if(Object.Notes__c != null && (Object.Notes__c.contains('Value1') || Object.Notes__c.contains('Value2')))

However, now I want to change the statement to see if the text entered in the Notes__c field on my custom object contains any of the values set in CustomSetting1. How would i go about that?

I've tried the following, but I'm not sure if this is right or will give me all the values in my custom setting:

List<Keywords__c> custSet = Keywords__c.Getall().Values();
        string keyWords=custSet[0].Name;

for(Object__c Object : Trigger.New){
     if(Object.Notes__c != null && Object.Notes__c.contains(keyWords))...

I have the below line that compares 2 text fields on a custom object to see if they contain specific values:

 if(Object.Notes__c != null && (Object.Notes__c.contains('Value1') || Object.Notes__c.contains('Value2')))

However, now I want to change the statement to see if the text entered in the Notes__c field on my custom object contains any of the values set in CustomSetting1. How would i go about that?

I have the below line that compares 2 text fields on a custom object to see if they contain specific values:

 if(Object.Notes__c != null && (Object.Notes__c.contains('Value1') || Object.Notes__c.contains('Value2')))

However, now I want to change the statement to see if the text entered in the Notes__c field on my custom object contains any of the values set in CustomSetting1. How would i go about that?

I've tried the following, but I'm not sure if this is right or will give me all the values in my custom setting:

List<Keywords__c> custSet = Keywords__c.Getall().Values();
        string keyWords=custSet[0].Name;

for(Object__c Object : Trigger.New){
     if(Object.Notes__c != null && Object.Notes__c.contains(keyWords))...
Source Link
J. Neilan
  • 1.2k
  • 4
  • 23
  • 54

Compare Text Field to Custom Setting Values

I have the below line that compares 2 text fields on a custom object to see if they contain specific values:

 if(Object.Notes__c != null && (Object.Notes__c.contains('Value1') || Object.Notes__c.contains('Value2')))

However, now I want to change the statement to see if the text entered in the Notes__c field on my custom object contains any of the values set in CustomSetting1. How would i go about that?