Skip to content

Instantly share code, notes, and snippets.

@eggsurplus
Created July 14, 2014 17:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eggsurplus/e94151f9e11523f60bfd to your computer and use it in GitHub Desktop.
Save eggsurplus/e94151f9e11523f60bfd to your computer and use it in GitHub Desktop.
Partial WebToLeadCapture.php for updating existing lead
if(empty($lead->id)) {
$lead->id = create_guid();
$lead->new_with_id = true;
}
//BEGIN - eggsurplus - update existing leads
if(!empty($_POST['record'])) {
//get the existing bean (returns null if a bad ID is passed so a new Lead will be created still)
$lead = BeanFactory::getBean('Leads',$_POST['record']);
$lead->new_with_id = false;
}
//END - eggsurplus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment