+ Start a Discussion
benfaustbenfaust 

Contact/Lead History

Is there any way to create a lead/contact history via the API? We want to make a history entry every time our system creates or updates a record. We're using PHP 4.x.
Gareth DaviesGareth Davies
Have a look at the "getUpdated" API call.
 
You could use this to simluate a time-stamping history trail by checking at regular intervals. You'd miss inter-check high-frequency snap shots but it might be good enough for your purposes?
 
Gareth.
 
 
----cut from API reference Manual

Retrieves the list of individual objects that have been updated (added or changed) within the given timespan for the specified object.

Syntax

GetUpdatedResult[] = sfdc.getUpdated(string sObjectType dateTime startDate 
dateTime EndDate); 

----cut

 

benfaustbenfaust
Thank you. This appears to retrieve data from Salesforce. What we actually need to do is record in SF a subject specifying where the changes/insertions originated and the date.
Park Walker (TAGL)Park Walker (TAGL)
It sounds like what you want to do is add an Activity record, probably with a status of 'Completed'. This should be very straight forward using the API as long as you have some way of retrieving the Contact/Lead to link the activity to. You'll need to link the Activity to a User record, so you'll also need the Id of a user, although it could be the same account that you're using to log into the API.

Park

Message Edited by Redsummit on 07-11-2006 04:27 PM

benfaustbenfaust
Super. :smileyhappy: Anywhere I can see a php sample of such a query?
benfaustbenfaust
I've looked in the small bit of documentation easily available for PHP and found no reference to the activities object. If anyone knows how we can insert an activities record, please let me know.
SuperfellSuperfell
Activities are Events or Tasks in the API, You can create new ones just like any other object in salesforce using the create method. The API docs are @ http://www.sforce.com/us/docs/sforce70/wwhelp/wwhimpl/js/html/wwhelp.htm