You need to sign in to do that
Don't have an account?

Remove values from List
I have a list of Id's defined as
Set<ID> ExistingContactIds = new Set<ID>();
With that list, i use as input to build a second list
list<account_access__c> ListMissingAcctContacts =
[SELECT account__c, contact__c, contact__r.name, contact__r.lastname, contact__r.firstname, contact__r.role__c
FROM account_access__c
WHERE isdeleted = FALSE AND contact__r.role__c = 'Owner' AND account__c IN :MissingAcctsIds
ORDER BY account__c, contact__r.lastname, contact__r.firstname];
The first list may have 10 separate Id's and the second list may only have data for 7 of those Id's. What is the easiest way to give me the values Id's from the first list that are NOT in the second list?
Thanks for any help you can provide.
Dan
Set<ID> ExistingContactIds = new Set<ID>();
With that list, i use as input to build a second list
list<account_access__c> ListMissingAcctContacts =
[SELECT account__c, contact__c, contact__r.name, contact__r.lastname, contact__r.firstname, contact__r.role__c
FROM account_access__c
WHERE isdeleted = FALSE AND contact__r.role__c = 'Owner' AND account__c IN :MissingAcctsIds
ORDER BY account__c, contact__r.lastname, contact__r.firstname];
The first list may have 10 separate Id's and the second list may only have data for 7 of those Id's. What is the easiest way to give me the values Id's from the first list that are NOT in the second list?
Thanks for any help you can provide.
Dan

Something like this should work