AnsweredAssumed Answered

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

Question asked by Derick van Niekerk on Nov 27, 2016
Latest reply on Nov 27, 2016 by Ishani Lad

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.