Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a "Log a Call" task with apex. I need this task to be marked as Closed but when I try to set the IsClosed field to true I'm getting the "Field not writable" error.

How can I work around this issue?

share|improve this question
up vote 9 down vote accepted

There is a field called status in task. Setting this to the string 'Completed' solves the issue. No need to write this isClosed flag. This flag gets checked once task status is closed.

share|improve this answer
There is a small code sample towards the end of… that demonstrates the use of Status = 'Completed'. – metadaddy Jan 15 '13 at 7:52
@metadaddy Wow!that integration is awesome .I read the blog post amazing work.thanks! – Mohith Shrivastava Jan 15 '13 at 8:47

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.