• EricRenfro
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies

I've been adding custom fields and regenerating enterprise wsdl all day yesterday. Of a sudden I try again today and it won't generate. Instead it says:

 

Invalid Package Version Specification
The specified Package Version Namespace is not installed 

 

This may be connected to the 4 Installed Packages I have, which each has a Package Version select, but they only have one option in each select so i can't change the Package Version.

Hi,

I've got an exception trying to upsert on a custom object with php toolkit 13:

Code:
SoapFault exception: [sf:INVALID_FIELD] INVALID_FIELD: No such column 'Comment__c' on entity 'contact'. in C:\Dev\Workspace\CnV\phptoolkit-13_0\soapclient\SforceBaseClient.php:419

Stack trace:

#0 [internal function]: SoapClient->__call('upsert', Array)

#1 C:\Dev\Workspace\CnV\phptoolkit-13_0\soapclient\SforceBaseClient.php(419): SoapClient->upsert(Object(stdClass))

#2 C:\Dev\Workspace\CnV\phptoolkit-13_0\soapclient\SforceEnterpriseClient.php(93): SforceBaseClient->_upsert(Object(stdClass))

#3 C:\Dev\Workspace\CnV\post.php(34): SforceEnterpriseClient->upsert('Comment__c', Array)

#4 {main}

 
I usually use update function, but now I'd like to upsert. There is my code:

My connexion functions:
Code:
define("SOAP_CLIENT_BASEDIR", "phptoolkit-13_0/soapclient");


require_once (SOAP_CLIENT_BASEDIR.'/SforceEnterpriseClient.php');
require_once (SOAP_CLIENT_BASEDIR.'/SforceHeaderOptions.php');
require_once ('phptoolkit-13_0/userAuth.php');

function ConnectSession($USERNAME,$PASSWORD)
{


    try 
    {
        $mySforceConnection = new SforceEnterpriseClient();
        $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml');
        $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD);
        $_SESSION['connexion'] = $mySforceConnection;

        $_SESSION['location'] = $mySforceConnection->getLocation();
        $_SESSION['sessionId'] = $mySforceConnection->getSessionId();
        $_SESSION['wsdl'] = SOAP_CLIENT_BASEDIR.'/enterprise.wsdl.xml';

    }
    catch (Exception $e)
    {
        echo $mySforceConnection->getLastRequest();
        echo $e->faultstring;
    }

}

function reconnect()
{
    $location = $_SESSION['location'];
    $sessionId = $_SESSION['sessionId'];
    $wsdl = $_SESSION['wsdl'];

    $mySforceConnection = new SforceEnterpriseClient();
    $sforceSoapClient = $mySforceConnection->createConnection($wsdl);
    $mySforceConnection->setEndpoint($location);
    $mySforceConnection->setSessionHeader($sessionId);

    $_SESSION['connexion'] = $mySforceConnection;
}

 


My upsert code on a 'Test_Case__c' custom object:

Code:
reconnect();

$sObject1 = new stdClass();
$sObject1->Comment__c = $_GET['comments'];
$sObject1->Id = $_GET['id'];


try
{

    $response = $_SESSION['connexion']->upsert('Comment__c',array ($sObject1));

}
catch(Exception $e)
{
    echo "Update FAILED";
    echo "erreur! ".str_replace("\n","<br>",$e);

}

 



and the response:


erreur! SoapFault exception: [sf:INVALID_FIELD] INVALID_FIELD: No such column 'Comment__c' on entity 'contact'. in C:\Dev\Workspace\CnV\phptoolkit-13_0\soapclient\SforceBaseClient.php:419

Stack trace:

#0 [internal function]: SoapClient->__call('upsert', Array)

#1 C:\Dev\Workspace\CnV\phptoolkit-13_0\soapclient\SforceBaseClient.php(419): SoapClient->upsert(Object(stdClass))

#2 C:\Dev\Workspace\CnV\phptoolkit-13_0\soapclient\SforceEnterpriseClient.php(93): SforceBaseClient->_upsert(Object(stdClass))

#3 C:\Dev\Workspace\CnV\post.php(34): SforceEnterpriseClient->upsert('Comment__c', Array)

#4 {main}


Why does uspert tries to update the contact object instead of my custom one?