Answered by:
plug-in

Question
-
hi
im tring to create plug in for custom entity,the poroblem is that sdk dll(the orginal microsoft.crm.sdk.dll) won't recognize the custom entity
i tried to add web refernce .. is there a way to update the orginal microsoft.crm.sdk.dll
the ICrmService --- can"t update custom entity
one more thing
is there any way of creating plug in Without define reference to web service
Wednesday, July 16, 2008 9:42 AM
Answers
-
In this case, you have to do it this way:
For new_entity:
entity = (DynamicEntity) context.InputParameters.Properties["Target"]
entity.Name != "new_entity";
entity.Properties[""] = ...........................;
TargetUpdateDynamic
target = new TargetUpdateDynamic();target.Entity = entity;
UpdateRequest request = new UpdateRequest();request.Target = target;
crmService.Execute(request);
- Marked as answer by DavidJennawayMVP, Moderator Monday, April 27, 2009 3:36 PM
Wednesday, July 16, 2008 2:54 PM
All replies
-
Hi, Try removing the CRM Web reference and then add it again.
Wednesday, July 16, 2008 10:02 AMModerator -
not workingWednesday, July 16, 2008 10:21 AM
-
You can create a plugin for custom entities. Context will return the Dynamic entity. And while registering the plugin you have to select your custom entity.
Here is the link for more info http://msdn.microsoft.com/hi-in/library/cc151102(en-us).aspx
Wednesday, July 16, 2008 11:42 AM -
The preferred way is to reference the original microsoft.crm.sdk.dll and use Dynamice Entities to deal with custom attributes and custom entities. You can still reference a web service but there is no infinite loop checking mechanism (e.g. updating contact triggers updating an account and there is code to update contact inside the account plugin.. etc) in the web reference.
So, the answer is, yes, you can and should create plugin without define refenece to web service, instead, you should simply just create a reference to microsoft.com.sdk.dll
Wednesday, July 16, 2008 1:32 PM -
hello
This my Problem In PlugIn
this code is working
entity = (DynamicEntity) context.InputParameters.Properties["Target"]
entity.Name != EntityName.account.Tostring
but EntityName dosn"t know my new_entity as i writed below
entity = (DynamicEntity) context.InputParameters.Properties["Target"]
entity.Name != EntityName.new_entity.Tostring
and i can"t create instace of my new_entity
like this new_entity test = new new_entity();
i want to create new custom Entity and update in crm with ICrmService at post create
Wednesday, July 16, 2008 2:42 PM -
In this case, you have to do it this way:
For new_entity:
entity = (DynamicEntity) context.InputParameters.Properties["Target"]
entity.Name != "new_entity";
entity.Properties[""] = ...........................;
TargetUpdateDynamic
target = new TargetUpdateDynamic();target.Entity = entity;
UpdateRequest request = new UpdateRequest();request.Target = target;
crmService.Execute(request);
- Marked as answer by DavidJennawayMVP, Moderator Monday, April 27, 2009 3:36 PM
Wednesday, July 16, 2008 2:54 PM