Technical Fun

Archive for May 2008

Holla, Ok, I am new to the world of CRM 4.0 Plug-Ins, and even though I wrote many callouts for CRM 3.0, that does not count to the experience. So, I am a flat newbie 🙂 [excuse mode ON].

Here’s the story; I was trying to hook to a post update event of the opportunity entity, and naturally wanting to do something based on the opportunityid I (should have) obtained easily.

Here’s the un-easy part;

Microsoft.Crm.Sdk.DynamicEntity opp = context.PostEntityImages["opportunity"] as Microsoft.Crm.Sdk.DynamicEntity;

and afterwards, I could call the Id (GUID) of the opportunity like this;

Microsoft.Crm.Sdk.Key okey = opp["opportunityid"] as Microsoft.Crm.Sdk.Key; Guid oppid = okey.Value;

Hmm… before I got here, I tried to use and register PreEntityImages, but failed. I tried to use OutputParameters of the context, and failed as well.

So, for post events, I’ll stick to this PostEntityImages thing.