• CWD
  • NEWBIE
  • 0 Points
  • Member since 2008

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

Hi, we are considering moving our entire front end web site to force.com - Can we track customers on the site without them logging in?

 

 

1. user submits a form on force.com site

2. we create a sf account and a unique cookie

3. can we then track that user via the cookie? Ie pages visited?

 

This would help with the sales process to know where and when the customer visited our site. Ie call them when they are on the site or even send an email when certain pages are viewed automatically.

 

thanks

matt

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?
Hi,

I'm having a problem getting the sforce API to return all columns through the API.  My scenario is this:-

(a) I have a custom object called "Foo Bar", hence the table name is Foo_Bar__c
(b) I have custom fields within that object, named apple, orange, banana, hence columns named apple__c orange__c and banana__c
(c) I have downloaded the freshly generated enterprise.wsdl that includes references to apple__c orange__c and banana__c etc...

Query example would be:-
"""
select apple__c, orange__c, banana__c from Foo_Bar__c
"""

Through the API I am able to retrieve some columns but not others without any appreciable logic as to why.  I've checked permissions, types, etc etc etc and I simply can't see what else I should be looking for.  Is there some kind of limit to the number of custom fields (columns) that an object can have that I'm unaware of?

Any ideas?

I'm using the sforce-phptoolkit on salesforce enterprise edition.  Please pardon my cross post here from the General Development board.

N