Skip to content
Snippets Groups Projects

Add lead convert event

Merged Alan Bell requested to merge alanbell/vtigercrm:add_lead_convert_event into master
+ 6
0
Compare changes
  • Side-by-side
  • Inline
@@ -265,6 +265,12 @@ function vtws_updateConvertLeadStatus($entityIds, $leadId, $user) {
$leadModifiedTime = $adb->formatDate(date('Y-m-d H:i:s'), true);
$crmentityUpdateSql = "UPDATE vtiger_crmentity SET modifiedtime=?, modifiedby=? WHERE crmid=?";
$adb->pquery($crmentityUpdateSql, array($leadModifiedTime, $user->id, $leadIdComponents[1]));
//raise an event so that modules can take their actions on lead conversion
require_once("include/events/include.inc");
$em = new VTEventsManager($adb);
$em->initTriggerCache();
$entityData = VTEntityData::fromEntityId($adb, $leadIdComponents[1]);
$em->triggerEvent("vtiger.entity.leadconverted", $entityData);
}
$moduleArray = array('Accounts','Contacts','Potentials');
Loading