Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a trigger with following code -

trigger Project_Trigger on Project__c (before update) {

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?

share|improve this question
up vote 15 down vote accepted

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) {
share|improve this answer
Perfect. Thanks Jesse! – dfo Jan 18 '13 at 17:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.