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
kabukabu 

Compi;ation error on CmpaignMember Field(Phone, MobilePhone) Assignment

I am getting error Invalid sobject field. 

CmpaignMember cm =new CmpaignMember();
cm.phone='9834734';
Any help appreciated.

thanks
K
James LoghryJames Loghry
Because A) You misspelled CmpaignMember or B) There is no Phone field on the CampaignMember object. It's a junction between Campaigns and either Leads or Contacts, so try setting it on either of those instead.  See here: http://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_campaignmember.htm
kabukabu
Hi James , Thanks for reply.
I see under Campaign Member Standard Fields there are many fields. are they not available in Apex to update.?

thanks
K