You need to sign in to do that
Don't have an account?
S2S CRM Admin
Get the FirstName from the CampaignMember Object
I am attempting to create a select statement that will pull all the first names of members that are signed up to a specific campaign. I am relatively new to using the Salesforce API so I decided to simplify it and just try to pull the first name of any member of any campaign. I wrote the following code:
I did confirm that all user profiles are allowed to view the CampaignMember object. From what research I have done I discovered that Salesforce use to have this bug. Has this been patched out, or is there another reason I am recieving the error?
SELECT FirstName FROM CampaignMemberWhen I run the statement I recieve the following error:
PHP Fatal error: Uncaught SoapFault exception: [sf:INVALID_FIELD] INVALID_FIELD: SELECT FirstName FROM CampaignMember ^ ERROR at Row:1:Column:8 No such column 'FirstName' on entity 'CampaignMember'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. in C:\Sites\s2s\htdocs\salesForce\soapclient\SforceBaseClient.php:808 Stack trace: #0 C:\Sites\s2s\htdocs\salesForce\soapclient\SforceBaseClient.php(808): SoapClient->__call('query', Array) #1 C:\Sites\s2s\htdocs\salesForce\soapclient\SforceBaseClient.php(808): SforceSoapClient->query(Array) #2 C:\Sites\s2s\htdocs\test.php(28): SforceBaseClient->query('SELECT FirstNam...') #3 {main} thrown in C:\Sites\s2s\htdocs\salesForce\soapclient\SforceBaseClient.php on line 808
I did confirm that all user profiles are allowed to view the CampaignMember object. From what research I have done I discovered that Salesforce use to have this bug. Has this been patched out, or is there another reason I am recieving the error?
Actually, CampaignMember information coming from Lead or Contact objects, so can you try the following code:
Here we try to get FirstName directly from parent object (Lead or Contact)
Thanks to your help I am now half way there. If I use the following statement in the developers console I get a successful result, but when I run it from my external php page I get the following errors.
Statement:
Error Messages that I recieve when I run the code from my php page: