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
chuckdubdubchuckdubdub 

Possible to use API to update records and avoid inserting dupes (NOOB)?

I'm working for a client who uses Salesforce.com's web-to-lead code to create new lead records from their web site.  As their business has grown they are seeing a greater number of duplicate lead records coming through.  These records can be merged, but they lose lead_source data when the duplicates are put together.  So via the web form, we need to be able to 1) Check to see if a lead record already exists and 2) Update an activity field on the record if the lead already exists rather than insert. 3) Insert if no record exists.
 
(Certainly email address could be a good query criteria for avoiding dupes.)
 
Anyway, would digging into any of the API toolkits give us this capability?  We're currently running PHP 4, on our web site, which probably means we can't use the currently available PHP toolkit which is for 5.x.
 
Thanks for any suggestions -- muchas gracias.
 
-Chuck

Message Edited by chuckdubdub on 03-15-2006 12:40 PM

adamgadamg
The toolkits aren't going to do this out of the box, but you can (fairly easily) write some PHP code to check to see if the email existings, etc and update accordingly.  If you can't find a link to the older PHP 4.0 based stuff (not as easy to use as the PHP5 toolkit, but still possible) post a message to the PHP boards and we'll dig it up.
chuckdubdubchuckdubdub
Will do, thanks!!
ClaiborneClaiborne

Ryan Choi has implemented a set of tools for interfacing between the sfdc api and php. This is from his post in December. His code does not require php 5 or Pear.

An update to the php_sforce_nusoap sourceforge project has been posted. It includes:

- fix for namespace of headers (lead assignment headers work properly now)
- rename of soapclient to nusoapclient (avoid conflict of php 5 SoapClient)
- getUpdated(), getDeleted() and retrieve() calls
- examples of the above in example.php

http://sourceforge.net/project/showfiles.php?group_id=96634&package_id=166314

benjasikbenjasik
How about using upsert on an email custom field?