You need to sign in to do that
Don't have an account?
jkropka
Creating a case using API
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?
$sf = new Salesforce::SforceService->get_port_binding('Soap');
$sf->login( %{user_and_passwd()} );
my $r = $sf->create( type=>'Case',
Subject=>'Request for Account',
Status=>'PSG',
Origin=>'E-mail',
Reason=>'System / User Setup',
Type=>'EDI',
OwnerId=> '00G00000006p7DnEAI', # some Queue
Description=> $body,
);
print "create Account Request case ",Dumper($r->result);
now you may need to tweak your Salesforce.pm , i know mine has a few tweaks from the standard one.
you are using perl , yes?
if so, you don't need an array() construct, but you do need a binding to the port
which is then "logged in"
Thanks.
$client = new SalesforceClient($SESSION);
$result = $client->create(array('type'=>'Case','ContactId'=>$ContactId,'Severity'=>$severity,'Subject'=>$subject, 'Description'=>$description));
which gives the result:
SOAP_Fault
common.exception.ApiException: Must send a concrete entity type.
I'm beginnin to think there is a problem with the SalesforceClient.php which
is in the developers toolkit from salesforce. I works OK fetching data from
salesforce, but not for create or update.
WebService_SforceService_Soap.php was pointing to the SOAP client here:
https://www.salesforce.com/services/Soap/c/6.0
I got it working by pointing to the client here:
https://www.salesforce.com/services/Soap/u/6.0
instead.