• jkropka
  • NEWBIE
  • 0 Points
  • Member since 2005

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 6
    Replies

Anone know how to create a case using the API

I have tried both of these methods:

  $fields = array('type' => 'Case',
   'Type'=>"$type",
   'ContactId'=>"$ContactId",
   'Severity' => "$severity",
   'Subject'=>"$subject",
   'Description'=>"$description");
  $case = new SF_Object($client,$fields);
  $case->set_fields($fields);

$ok = $case->add();

and also

$ok = $sfobj->create($case);

Both methods give the result:

 common.exception.ApiException: Must send a concrete entity type.

What am I missing about creating (inserting) new cases?

I'm using the interface through:
https://www.salesforce.com/services/Soap/c/6.0

to log in and retrieve data OK, but when I try to create records
I get the message :
soapenv:Server common.exception.ApiException: Must send a concrete entity type. INVALID_TYPE Must send a concrete entity type. -1 -1
I'm logging into the Enterprise account.


my code:

$sfobj = new SalesforceClient();
$ds_login = "validuser";
$ds_pass = "validpass";
$res=$sfobj->login($ds_login, $ds_pass);


if (PEAR::isError($res))
{
$errors = "Error: " . $res->getMessage() . "\n";
$_SESSION['err'] = '2';
$_SESSION['msg'] = $errors;
header("Location: /sserv/");

}
else
{
//$debug = new array_parse($_SESSION,"session VARS - ".__LINE__."-".__FILE__); echo $debug->output_var;
$_SESSION['serverUrl']=$res->serverUrl;
$_SESSION['sessionId']=$res->sessionId;
$_SESSION['loggedInName'] = $loggedInName;

$_SESSION['err']="";
$_SESSION['msg']="";

}

$sfobj->addSessionParameters($_SESSION['sessionId'],$_SESSION['serverUrl']);


After the session is happy I can build my sql's and execute queries with no
problem using the client code, but the create fails

Create code:
function &create($sObjects)
{
$this->addSessionHeader();
return parent::create($sObjects);
}
(from the samples)
and my code to do the create:


$contact->type="Contact";
$contact->AccountId = "validid";
$contact->Email - "one@two.com";
$contact->LastName = "Last";

$args->sObjects = new SoapVar($contact, SOAP_ENC_OBJECT, "Contact", "http://soapinterop.org/xsd");

$sfobj->create($args);

anyone see what I am doing wrong?

Anone know how to create a case using the API

I have tried both of these methods:

  $fields = array('type' => 'Case',
   'Type'=>"$type",
   'ContactId'=>"$ContactId",
   'Severity' => "$severity",
   'Subject'=>"$subject",
   'Description'=>"$description");
  $case = new SF_Object($client,$fields);
  $case->set_fields($fields);

$ok = $case->add();

and also

$ok = $sfobj->create($case);

Both methods give the result:

 common.exception.ApiException: Must send a concrete entity type.

What am I missing about creating (inserting) new cases?

I'm using the interface through:
https://www.salesforce.com/services/Soap/c/6.0

to log in and retrieve data OK, but when I try to create records
I get the message :
soapenv:Server common.exception.ApiException: Must send a concrete entity type. INVALID_TYPE Must send a concrete entity type. -1 -1
I'm logging into the Enterprise account.


my code:

$sfobj = new SalesforceClient();
$ds_login = "validuser";
$ds_pass = "validpass";
$res=$sfobj->login($ds_login, $ds_pass);


if (PEAR::isError($res))
{
$errors = "Error: " . $res->getMessage() . "\n";
$_SESSION['err'] = '2';
$_SESSION['msg'] = $errors;
header("Location: /sserv/");

}
else
{
//$debug = new array_parse($_SESSION,"session VARS - ".__LINE__."-".__FILE__); echo $debug->output_var;
$_SESSION['serverUrl']=$res->serverUrl;
$_SESSION['sessionId']=$res->sessionId;
$_SESSION['loggedInName'] = $loggedInName;

$_SESSION['err']="";
$_SESSION['msg']="";

}

$sfobj->addSessionParameters($_SESSION['sessionId'],$_SESSION['serverUrl']);


After the session is happy I can build my sql's and execute queries with no
problem using the client code, but the create fails

Create code:
function &create($sObjects)
{
$this->addSessionHeader();
return parent::create($sObjects);
}
(from the samples)
and my code to do the create:


$contact->type="Contact";
$contact->AccountId = "validid";
$contact->Email - "one@two.com";
$contact->LastName = "Last";

$args->sObjects = new SoapVar($contact, SOAP_ENC_OBJECT, "Contact", "http://soapinterop.org/xsd");

$sfobj->create($args);

anyone see what I am doing wrong?

After upgrading to VStudio 2003, my build fails with error:

'The type or namespace 'salesforce' could not be found.'

on this line:

private static salesforce.SforceService binding = null;

I have the WSDL added in Web References and is called 'salesforce'

What else do I need to do?  I also did grab the latest WSDL for the organization, so I'm not %100 sure it is related to the VStudio upgrade...