+ Start a Discussion

nstructor syntax, name=value pairs can only be used for SObjects



any thing wrong in my code


list<Account> accts = new list<Account>{new Account(name='test account')};


Account[] newaccts =new Account[]{new Account(name='dev account')};


Do you have a local class called Account?  That's usually been the issue for me.




In my case, I do have a Contact class declared locally... is there a way to point to that class instead the global sforce class Contact... like this.Contact... and how can I point to the global class...


thanks in advanced... // _e

hi, if helps... finally found the Super class that holds the Generic objects from Salesforce.... is Schema. If you have a local class called like one of the salesforce objects, use the name of the class to access that class and if you want to access one of the global objects, use Schema.'ClassName' global class MyWebMethods { class Contact { string name; } } MyWebMethods.Contact <- local Schema.Contact <-global hope this helps...