4

I have a trigger with following code -

trigger Project_Trigger on Project__c (before update) {
    PepsiProjectManager.projectBeforeUpdate(Trigger.oldMap, Trigger.new);
}

And a class with methods for this and other triggers -

public class PepsiProjectManager {
    ...
    public static void projectBeforeUpdate(Map<String, Project__c> oldProjectsMap, 
            List<Project__c> newProjects) {
        ...
    }
}

IDE says 'method doesn't exist or incorrect signature'.

This -

    public static void projectBeforeUpdate(Map<Project__c> oldProjectsMap, 
            List<Project__c> newProjects) {
        ...
    }

doesn't work either. The error is 'map must have exactly 2 arguments'. What is the first argument?

1 Answer 1

16

Trigger.oldMap should return a type of

Map<Id, sObject__c>

Try changing your code to

public static void projectBeforeUpdate(Map<Id, Project__c> oldProjectsMap, 
                                       List<Project__c> newProjects) {
     ...
}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .