Question Status

Verified
Andrew Ciccarelli asked a question on 16 Jul 2013 5:34 PM

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?

Reply
Verified Answer
Scott Durow responded on 17 Jul 2013 12:48 AM

You really need to find out what exception is being thrown - use platform tracing - crmdiagtool2011.codeplex.com

It could be a record locking issue - could you not update the email target in the pre-event pipeline step without using the service.Update?

hth

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply
Alessandro Cortese responded on 6 Aug 2013 6:55 AM

try to debug remotely the plugin and see what is going wrong

msdn.microsoft.com/.../bt727f1t.aspx

Reply
Verified Answer
Scott Durow responded on 17 Jul 2013 12:48 AM

You really need to find out what exception is being thrown - use platform tracing - crmdiagtool2011.codeplex.com

It could be a record locking issue - could you not update the email target in the pre-event pipeline step without using the service.Update?

hth

Scott Durow

Read my Blog   |  Follow Me on Twitter  |  Rockstar365

Reply