2014-02-27 22 views
0

我已經通過Visual Studio中的CRM工具註冊了一些實體更新消息(在操作後)的插件,並且還註冊了該插件的後置圖像,如下所示:PostEntityImage更新消息post-operartion沒有任何關鍵

enter image description here

enter image description here

這裏是我的代碼:

保護無效ExecutePostOpportunityUpdate(LocalPlug inContext的 localContext) {

 if (localContext == null) 
     { 
      throw new ArgumentNullException("localContext"); 
     } 




     // TODO: Implement your custom Plug-in business logic. 
     IPluginExecutionContext context = localContext.PluginExecutionContext; 

     Entity postImage = (Entity)context.PostEntityImages["PostImage"]; 

....

}

但它拋出一個錯誤,說有在PostEntityImages沒有鑰匙的。我調試了插件,發現沒有任何關鍵。

你能幫我嗎?

回答

1

那麼看你的代碼,你需要檢索的機會實際實體:試試這個

​​
+1

感謝....它可能似乎是調侃,但重新啓動CRM服務器解決了這個問題,現在原像和PostImage是填充! –

+1

Wellcome是的,它有時也發生在我身上。回收crm應用程序可以完成這項工作,這是gOOD實踐之一。 :d –