• Robert Stathis
  • NEWBIE
  • 0 Points
  • Member since 2023

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
I need to compare one list to another but it is not allowing me to do so
public class ContactTriggerHandler {
    public static void IsPricingLetter(List<Contact> con){
            Id CRMUSRecordType = Schema.SObjectType.Contact.getRecordTypeInfosByName().get('CRM Contact US').getRecordTypeId();
           //Get a list of all contact ID's that have an active Relationship and of the Pricing Letters type 
        list<accountcontactrelation> PricingLettersCheck = new list<accountcontactrelation>([SELECT id,ContactID,roles From accountContactRelation 
                                                                                           WHERE contactid in :con AND Roles INCLUDES (:label.messer_us_pricing_letter) AND isactive=true]);
        
        
        List<Contact> ContactLookup = new List<Contact>();
        for(Contact ConList :con){
            if (ConList.recordtypeid==CRMUSRecordType){
    //I NEED TO COMPARE THE PRICINGLETTERS CHECK HERE>>       if(conlist.id IN :PricingLettersCheck.contactid){
                
                ContactLookup.add(ConList);
                }
                    }//end if
        }//end for loop