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<Contact> allContacts = [SELECT Id, Name FROM Contact];
List<Interaction__c> allInteractions = [SELECT *fields* FROM Interaction__c];
List<Interaction__c> relInterations = new List<Interaction__c>();for(Account act : accounts){
for(Interaction__c relInt : allInteractions) {
if((ID)relInt.AccountID__c = act.Id){
I get the error
Expression cannot be assigned
If I remove the (ID) I get
Condition expression must be of type Boolean: Id
How can I solve this problem? Could it be because I am using Database.Batchable and the list accounts is void? I don't totally understand the void vs static in this case.
As an aside, I tried act.contains(relInt.AccountID__c) and it says that method does not exist, which seems to be the opposite of what the documentation says, right?