I am currently trying to get this trigger to work:
trigger ContactRelatedOpportunities on Opportunity (after insert, after update) {
List<Opportunity> Opps = [SELECT Id FROM Opportunity WHERE Opportunity.Id IN :Trigger.New];
ContactRelatedOppsClass.OpportunitiesUpdates(Opps);
}
That is using the following Class:
public class ContactRelatedOppsClass {
@future
Public static void OpportunitiesUpdates (List<ID> Opps){
for (ID a:Opps){
Opportunity OpportuniteAnalysee = [SELECT ID, Name, iCom_QTC__Contact__c FROM Opportunity WHERE ID =:a];
Contact ContactAssocie = [SELECT Id,LatestWonOpp__c,LatestLostOpp__c,NextWonOpp__c,NextOpp__c FROM Contact WHERE Id =:OpportuniteAnalysee.iCom_QTC__Contact__c];
System.debug(ContactAssocie);
// dernière demande gagnée
List <Opportunity> latestWonOpp = [SELECT Id
FROM Opportunity
WHERE (iCom_QTC__Contact__c = :ContactAssocie.ID AND StageName='Demande gagnée' AND Nombre_de_jours_relatif_event__c >= 0)
ORDER BY Nombre_de_jours_relatif_event__c
LIMIT 1];
if(latestWonOpp != null && !latestWonOpp.isEmpty()){
ContactAssocie.LatestWonOpp__c = latestWonOpp[0].Id;
} else {
ContactAssocie.LatestWonOpp__c = null;
}
update ContactAssocie;
}}}
But keep getting the error message "Method does not exist or incorrect signature: void OpportunitiesUpdates(List) from the type ContactRelatedOppsClass"
Please need help ! Thank you !