can't update email in email post save plugin?

This question is answered

Hello - I have plugin for email create. I get a handle to the email object in the plugin in the normal way and I'm able to access all of the expected email properties.

As part of the email create logic, I create a case and then associate the email with the case by setting the email RegardingObjectId = case ID.

Then I try to update the email object using the service context: service.Update(email).

I'm able to use the service in the same plugin to create a contact and case but I can't use the service to update the email object. It returns a rather unhelpful FaultException: "An unexpected error occured."

I also tried using the service at the very beginning to update the email object, right after I get the email object from the context, and I get the same unexpected error. This tells me that the error does not have to do with setting a property on the email.

If I get a handle to the current object in its post-save plugin, do I need to do something special with it in order to call the service.Update method on it? Based on this problem description can you figure out what I'm doing wrong here?

Verified Answer
All Replies