• API User 189
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
When a Lead is converted into an account, it gives the option to create a Pipeline opportunity. My issue is that if selected, I cannot edit this opportunity's fields via a trigger (I have both a trigger for when the Opportunity is created and when a Lead is converted and neither work for that opportunity). Strange thing is that if the opportunity is created before or after the conversion, my triggers are able to edit these fields. Is there a reason that the conversion opportunity is uneditable? Is there a workaround to this problem?
I am trying to programmatically reduce the number of tasks. I ran a simple query using in Apex Execute Anonymous:
 
List<Task> tasks = [Select Id from Task WHERE Subject Like '%Was Email Sent%'];
System.debug(tasks.size());
delete tasks;

To my confusion, the query came back with 0 results, even though I know for a fact that a task with that string in the subject exists. I then went  to an actual Task with that in the subject and ran this query:
 
List<Task> tasks = [Select Id from Task WHERE Id = '00TA000002lcsWy'];
System.debug(tasks);
delete tasks;

But that returned 0 results. I can manually edit and delete these tasks, but for some reason, I can't query them.
I did notice that the Tasks that were queriable have IDs that begin with 00T1 whilst these start off with 00TA. Is there anything to that? Are they recognized as a completely different object? 

 
When a Lead is converted into an account, it gives the option to create a Pipeline opportunity. My issue is that if selected, I cannot edit this opportunity's fields via a trigger (I have both a trigger for when the Opportunity is created and when a Lead is converted and neither work for that opportunity). Strange thing is that if the opportunity is created before or after the conversion, my triggers are able to edit these fields. Is there a reason that the conversion opportunity is uneditable? Is there a workaround to this problem?