• S2S CRM Admin
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
I need to creat a select statement that will pull the first name, last name, and title of all the people who have signed up for a specific event in salesforce. To do this I built the following statement:
SELECT Contact.FirstName, Contact.LastName, Contact.Title FROM CampaignMember WHERE CampaignId='701i00000010q96'

This statement works just fine when I put the statement into my php file and run it I get the following error statements:
PHP Notice:  Undefined variable: record in C:\Sites\s2s\htdocs\tech_demo\salesForce\soapclient\SforceBaseClient.php on line 973
PHP Notice:  Trying to get property of non-object in C:\Sites\s2s\htdocs\tech_demo\test.php on line 34
PHP Notice:  Trying to get property of non-object in C:\Sites\s2s\htdocs\tech_demo\test.php on line 34
PHP Notice:  Trying to get property of non-object in C:\Sites\s2s\htdocs\tech_demo\test.php on line 35
PHP Notice:  Trying to get property of non-object in C:\Sites\s2s\htdocs\tech_demo\test.php on line 35
PHP Notice:  Trying to get property of non-object in C:\Sites\s2s\htdocs\tech_demo\test.php on line 36
PHP Notice:  Trying to get property of non-object in C:\Sites\s2s\htdocs\tech_demo\test.php on line 36

Line 34, 35, and 36 are where I print the results to the screen. This leads me to believe that the root cause of the problem is the first error, the only problem is I do not understand why I am getting that error.
I am using the NPSP and I am trying to write a select statement that will gather all of the events that are part of a single campaign.
I have come up with the following statement:
SELECT Name from GW_Volunteers__Volunteer_Job__c WHERE Campaign='701i00000010q96'

When I run this statement I recieve the following error:
PHP Fatal error:  Uncaught SoapFault exception: [sf:INVALID_FIELD] INVALID_FIELD: 
GW_Volunteers__Volunteer_Job__c WHERE Campaign='701i00000010q96'
                                      ^
ERROR at Row:1:Column:56
No such column 'Campaign' on entity 'GW_Volunteers__Volunteer_Job__c'. 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(27): SforceBaseClient->query('SELECT Name fro...')
#3 {main}
  thrown in C:\Sites\s2s\htdocs\salesForce\soapclient\SforceBaseClient.php on line 808

When I look on the schema, it shows Campaign as part of the object, and from the research that I have done I know that I am allowed to view the campaign information. What exactly am I doing incorrectly?
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:
SELECT FirstName FROM CampaignMember
When 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? 
 
I am using the NPSP and I am trying to write a select statement that will gather all of the events that are part of a single campaign.
I have come up with the following statement:
SELECT Name from GW_Volunteers__Volunteer_Job__c WHERE Campaign='701i00000010q96'

When I run this statement I recieve the following error:
PHP Fatal error:  Uncaught SoapFault exception: [sf:INVALID_FIELD] INVALID_FIELD: 
GW_Volunteers__Volunteer_Job__c WHERE Campaign='701i00000010q96'
                                      ^
ERROR at Row:1:Column:56
No such column 'Campaign' on entity 'GW_Volunteers__Volunteer_Job__c'. 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(27): SforceBaseClient->query('SELECT Name fro...')
#3 {main}
  thrown in C:\Sites\s2s\htdocs\salesForce\soapclient\SforceBaseClient.php on line 808

When I look on the schema, it shows Campaign as part of the object, and from the research that I have done I know that I am allowed to view the campaign information. What exactly am I doing incorrectly?
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:
SELECT FirstName FROM CampaignMember
When 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?