function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
prady-cmprady-cm 

Method does not exist or incorrect signature: createCGM(SET<String>, LIST<User>)

Hi,

 

I having a class where i am calling another method in that class. for some reason i am getting this error

Method does not exist or incorrect signature: createCGM(SET<String>, LIST<User>)

 I am sure i am missing something very silly.

Here is how the class is defined

 

public class helper_User 
{
   public static List<User> syncUsingEmail()
   {
Set<String>    setDivision = new Set<String>();
        List<user>    u = new List<user>();
 // do something

 createCGM(setDep, u); // Errors out here } public void createCGM(Set<String> setDep, List<User> u) { // do something } }

 

Best Answer chosen by Admin (Salesforce Developers) 
JitendraJitendra

static method cannot call non static method.

please redeclare to 

 public static void createCGM(Set<String> setDep, List<User> u)
   {
    // do something
   }

 Let me know in case further help needed.

All Answers

JitendraJitendra

static method cannot call non static method.

please redeclare to 

 public static void createCGM(Set<String> setDep, List<User> u)
   {
    // do something
   }

 Let me know in case further help needed.

This was selected as the best answer
mauricio.ramos@corpitalmauricio.ramos@corpital

I don't see where you are declaring the createCGM(setDep, u) set. You are trying to pass that as a parameter to the method but as far as I can see you have declared the set with another name: 

 

Set<String>    setDivision = new Set<String>();

 

Maybe you should rewrite the code to:

 

createCGM(setDivision , u); // Errors out here

prady-cmprady-cm

Ah!!! How silly of me :)

 

Thanks Jitendra