I have this following scenario :

In lead i have a checkbox called Created_By_SF_WEB and if it is checked true then i am going to create task automatically using apex trigger (using after inserting of lead). Now, when i am going to convert this lead by clicking on convert button it take me to another lead convert page and from there lead is converting with Account, contact, opportunity with task(this task is different than we have created from the trigger), so basically adtger converting the lead it converting into Account, contact and opportunity with two Task (one is created by that trigger and one is from stadard lead convert process)

the problem i am facing is : i am going to update the status of both task after converting using below mentioned trigger but don't know why status get updated only for one task which is came from standard lead convertion process(this is working), task's status which is came from the trigger is not set as i expected

i have used this following URL for apex trigger : https://developer.salesforce.com/forums/?id=906F000000092F0IAI

can anybody help me to get rid of this

help would be appriciated !!


1 Answer 1


@Nail David

Your first triggered task will not be updated by the mentioned trigger codes in here

Those codes handle only tasks related to an opportunity, as you created the first task while entering the lead, you will not have any relation to an opportunity.

You will need to have a trigger on the lead or contact to update the very first task status

The second task updates fine as you said you converted the lead into Account / Contact / Opportunity , therefore the assumption is that this task is related to that new opportunity, but the first task from the trigger can't be related to the opportunity as it didn't exist at this time

  • Thanks for the reply is it possible to share code ?
    – Nail David
    May 16, 2017 at 5:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .