Answered by:
Difference Between SetState and SetStateDynamicEntity

Question
-
Hi,
What is the difference between the SetState and SetStateDynamicEntity messages and what event(s) are they used for?
Thanks in advance.
Wednesday, March 24, 2010 5:47 PM
Answers
-
here 's answer from http://blogs.msdn.com/crm/archive/2008/03/07/developing-plug-ins-for-crm-4-0.aspx
Why do I need to register on SetState and SetStateDynamicEntity separately?
· there are multiple messages that perform the same action in CRM. One such example is SetStateRequest and SetStateDyanmicEntityRequest . If you want to write a plug-in on SetState, then you need to register it on both messages
- Proposed as answer by ckeller Thursday, March 25, 2010 1:03 AM
- Marked as answer by DavidBerryMVP, Moderator Saturday, December 11, 2010 1:25 AM
Wednesday, March 24, 2010 5:55 PM -
they both do the same thing but diffrently
SetState will be used to set State for specific entity
while SetStateDyanmicEntity will also usd to set state for dynaminc entity (but you need to provide entity name for the same)..meaning this will also do the same thing..
the SetStateDynamicEntity request generally get used during plugin/custom workflow code becuase in that code you can not get referance/intellisense for custom entity......so SetStateDynamicEntity will be used to set state for this custom entity..
Hope this helps..
- Marked as answer by DavidBerryMVP, Moderator Saturday, December 11, 2010 1:25 AM
Thursday, March 25, 2010 7:28 PM
All replies
-
here 's answer from http://blogs.msdn.com/crm/archive/2008/03/07/developing-plug-ins-for-crm-4-0.aspx
Why do I need to register on SetState and SetStateDynamicEntity separately?
· there are multiple messages that perform the same action in CRM. One such example is SetStateRequest and SetStateDyanmicEntityRequest . If you want to write a plug-in on SetState, then you need to register it on both messages
- Proposed as answer by ckeller Thursday, March 25, 2010 1:03 AM
- Marked as answer by DavidBerryMVP, Moderator Saturday, December 11, 2010 1:25 AM
Wednesday, March 24, 2010 5:55 PM -
But what's the difference between the two?Thursday, March 25, 2010 6:19 PM
-
they both do the same thing but diffrently
SetState will be used to set State for specific entity
while SetStateDyanmicEntity will also usd to set state for dynaminc entity (but you need to provide entity name for the same)..meaning this will also do the same thing..
the SetStateDynamicEntity request generally get used during plugin/custom workflow code becuase in that code you can not get referance/intellisense for custom entity......so SetStateDynamicEntity will be used to set state for this custom entity..
Hope this helps..
- Marked as answer by DavidBerryMVP, Moderator Saturday, December 11, 2010 1:25 AM
Thursday, March 25, 2010 7:28 PM