Take the 2-minute tour ×
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.

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

1 Answer 1

up vote 7 down vote accepted

http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_task.htm

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
1  
There is a small code sample towards the end of blogs.developerforce.com/developer-relations/2012/08/… 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

 
discard

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.