• Lee Hildebrand
  • NEWBIE
  • -1 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies

I want to set the record type on a task I have created in apex with code similar to below but I don't see any property on the task object where I can do this, any ideas?

 

 Task myTask = new Task();
 myTask.Subject = 'Follow up task for opportunity';

 

The bigger problem I am trying to solve is create tasks in a trigger on opportunity creation. I can do this ok but I want to make sure they can not be deleted without affecting the delete permissions on any other kind of task. I thought about doing this by creating a task with a different record type so I could assign a page layout to it where the delete button is not available. I don't know if there is another way.

  • September 28, 2010
  • Like
  • 0