Change lead status back to 'New' when converting without opportunity

When a lead is converted to a contact with an account, I would like the lead status to remain 'New' if there is no opportunity associated with it.

The only time a lead should be in a 'Converted' status is when the lead has been converted to an opportunity.

In other words, when converting a link without specifying the optional opportunity, it should work exactly the same as if I have added a new lead to the account via the 'Create' button on the Leads subpanel.

I have tried with a simple logic hook:

    // If there is no pipeline associated, the lead status should remain as 'New'
    function convertAndCheckPipeline($bean, $event, $arguments)
    {
        if(empty($bean->opportunity_id)) {
            $bean->status = 'New';
            // $bean->converted = false;
        }
    }

This is ineffective because the status gets changed to 'Converted' later in the process.

Parents Reply
  • Thanks Ishani Lad - Your comment about custom code put me on the right track! In my case it has to do with the Marketo connector. The connector overrides whatever I set in the Logic hook:

    // From modules/Connectors/connectors/sources/ext/soap/marketo/marketo.php
    // lines 1591 - 1958

    // Once a lead has been converted to a contact, no further updates are synced as 'Lead'
            if ($this->isLeadConverted($bean)) {
                $bean->mkto_sync = false;
                $bean->mkto_id = '';
                $bean->status = 'Converted'; // <-- Causes my issues
                $bean->converted = true;
                return false;
            }

    Hopefully this saves someone else some pain.

Children