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
nhnh 

Perl API -Lead Assignment Problem

Any lead records we create via the API do not follow any assignment rules, they always get stamped as owned by the user the API logged in as. However, leads created using the 'CGI based' webtolead interface do follow assignments.

We were told in order to fix this, it is necessary to set API header options for autoAssign and assignment RuleId.

We 'patched' the Soap Client API 'create' method and added 2 SaveOptions:

my $r = $client->call($method =>
SOAP:ata->name('sObjects' => \SOAP:ata->value(@elems))
->attr( { 'xsi:type' => 'sfons:'.$type } ),

SOAP::Header->name('SaveOptions' => \SOAP::Header->name('autoAssign' => "1" )),
SOAP::Header->name('SaveOptions' => \SOAP::Header->name('assignmentRuleId' => "01Q3000000002i3" )),

$self->get_session_header());

We monitored the lead create with SOAP debug on. The options were generated and accepted and the lead records created. However, we still cannot get lead records to assign correctly.

Are we setting the 'SaveOptions' correctly? Is there something we are doing wrong?

We are creating thousands of leads through the API and its critical to us to get the assignment process automated and not rely on manual updates via the Sforce web interface.

Any help on this would be greatly appreciated,

Thanks

Nigel
adamgadamg
Can you post the full SOAP request so that we can take a look? Thx.
nhnh
Adam,

Below is the XML to create a lead record and create a associated CampaignMember link record. Not sure if autoAssign needs to be set to 'true' or if '1' will do.

Nigel


SOAP::Transport::HTTP::Client::send_receive: POST https://na1-api.salesforce.com/services/Soap/c/2.5
Accept: text/xml
Accept: multipart/*
Content-Length: 2312
Content-Type: text/xml; charset=utf-8
SOAPAction: ""



>>

>
>
>1
>
>01Q3000000002i3
>
>ppFdOpmy8Tn4AzZ54mAgBpjDb5.v.TqAl2NvK6jbECvhHoNcpEJy6Xrwig5hK5QC4ea9wkYDJR2D1Thu7UyvpfbtzKggVlhL
>
>
>
>United States
>no
>2174
>NigelTEST
>Startup
>Sole Proprietor
hone xsi:null="1" xsi:type="xsd:string"/>
>Hall
ostalCode xsi:type="xsd:string"
>95407ostalCode>
>Santa Rosa
>Yes
>web
>nigelh@sonic.net

>E-Myth
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Date: Fri, 19 Mar 2004 00:00:29 GMT
Server: Resin/2.1.s030924
Content-Type: text/xml; charset=utf-8
Client-Date: Fri, 19 Mar 2004 00:00:30 GMT
Client-Peer: 63.146.199.40:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, Inc./OU=Applications/OU=Terms of use at www.verisign.com/RPA (c)01/CN=na1-api.salesforce.com
Client-SSL-Cipher: DES-CBC3-SHA
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked







00Q30000001PqdpEAC
true




Lead Created id=00Q30000001PqdpEAC
SOAP::Transport::HTTP::Client::send_receive: POST https://na1-api.salesforce.com/services/Soap/c/2.5
Accept: text/xml
Accept: multipart/*
Content-Length: 1368
Content-Type: text/xml; charset=utf-8
SOAPAction: ""



>>

>
>
>1
>
>01Q3000000002i3
>
>ppFdOpmy8Tn4AzZ54mAgBpjDb5.v.TqAl2NvK6jbECvhHoNcpEJy6Xrwig5hK5QC4ea9wkYDJR2D1Thu7UyvpfbtzKggVlhL
>
>
>
>Responded

>701300000000EfCAAU
>00Q30000001PqdpEAC
SOAP::Transport::HTTP::Client::send_receive: HTTP/1.1 200 OK
Date: Fri, 19 Mar 2004 00:00:30 GMT
Server: Resin/2.1.s030924
Content-Type: text/xml; charset=utf-8
Client-Date: Fri, 19 Mar 2004 00:00:30 GMT
Client-Peer: 63.146.199.40:443
Client-Response-Num: 1
Client-SSL-Cert-Issuer: /O=VeriSign Trust Network/OU=VeriSign, Inc./OU=VeriSign International Server CA - Class 3/OU=www.verisign.com/CPS Incorp.by Ref. LIABILITY LTD.(c)97 VeriSign
Client-SSL-Cert-Subject: /C=US/ST=California/L=San Francisco/O=Salesforce.com, Inc./OU=Applications/OU=Terms of use at www.verisign.com/RPA (c)01/CN=na1-api.salesforce.com
Client-SSL-Cipher: DES-CBC3-SHA
Client-SSL-Warning: Peer certificate not verified
Client-Transfer-Encoding: chunked







00v30000000PEGzAAO
true



adamgadamg
Perhaps you can save the XML as a text file and attach it to the post?

thx.
nhnh
how do you attach a text file to a message. I don't see a link anywhere.

The previous message I posted I cut and pasted the XML.

Message Edited by nh on 04-05-2004 08:39 AM