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
WarriorWarrior 

INVALID FIELD: No such column ' ' on entity oppurtunity

  • Here is a snippet of my code :

         $fields = array (
           'OwnerId__c' => $owner_id,
           'Account Name' => $result["title"],
           'AccountId__c' => $result["id"],
           'Type' => "Existing Business",
           'Lead Source' => 'Other',
           'CurrencyIsoCode__c' => 'USD',
           'Stage' => 'New Opportunity',
           'Close Date' => $result["close_date"],
           'Product_Type__c' => $result["product_type"],
           'Renewal__c' => true,
           'Description' => $result["description"]
         );

         $sObject = new SObject();
         $sObject->fields = $fields;
         $sObject->type = 'Opportunity';

 

So when i run this, my code connects to salesforce but i get the error in teh subject line. Any ideas?

 

Jess_LopezJess_Lopez

It looks like some of your field names aren't the actual API Names. For starters, try changing these. 

  • OwnerId__c should just be OwnerId.
  • AccountId__c should just be AccountId.
  • Lead Source shoud be LeadSource.
  • Stage should be StageName
  • Close Date should be CloseDate

 

WarriorWarrior

Hey , I tried making the changes you suggested and I still got the error, any other suggestions? Could it have something to do with my WSDL file>

Jess_LopezJess_Lopez

Potentially -- definitely generate a fresh WSDL file. Also, with "Account Name"... if you are using AccountId, you'll be able to get this automatically. If you are doing an insert of an Opportunity, it won't want that Account Name, just the Id. Try taking that out and see what happens.