0

I can insert data to salesforce in any standard object Like Leads, Contacts etc . But my client has created a custom object . That object name is survey , and there are several survey questions Like your occupation ? Do you own or rent etc . I can't insert data into Survey . In case of Standard object I can insert data by using salesforce php toolkit . Like below

 $lead = new stdClass;
 $lead->type = '';
 $lead->fields = array(
      'Own_Or_Rent__c' => 'Own',
      'Your_Occupation__c' =>'Job',

 );
$result = $mySforceConnection_enterprise->create(array($lead), 'Lead');

But in this case my client has provided me with the ID of the the object "Survey__c" and and ids of those question like a04g000000CcfSAAAZ, a04g000000CcfSPAAZ etc . How can I insert survey result with these kind of info ?

I have tried like this

 $lead = new stdClass;
 $lead->type = '';
 $lead->fields = array(
      a04g000000CcfSAAAZ => 'Own',
      'Your_Occupation__c' => 'Job',

 );
$result = $mySforceConnection_enterprise->create(array($lead), 'Survey__c');

But it didn't work

0

From the information you got it might be a little hard to understand what the architecture is.

I have a feeling that there are 2 object, one is the Survey__c object and the other is the one whose ids he provided. Ids in salesforce are given to existing records, so there is no way to insert a record and specify an id. You can use the id to update records though.

Think of a salesforce id like a SQL GUID. Each record in a table will have a different system given id.

Your customer will have to specify what type of records contain those ids and then you can go from there.

Hope this helps you!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.