+ Start a Discussion

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?
----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.


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



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.


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

Super. :smileyhappy: Anywhere I can see a php sample of such a query?
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.
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