Difference between Execute, create ,delete and update in MS CRM 2011
-
18. dubna 2012 14:35
Hi
By using the Execute method of IOrganization service we can do the common functionalities like create ,delete and update of data records, why we need create, delete and update methods specifically?
Thanks,
Srikanth Reddy
Všechny reakce
-
18. dubna 2012 19:41
Hi Srikanth,
Create, delete and updates methods can only perform its own individual functionality.
for example, Create can create any entity. Delete can delete any entity record. Update can update any entity record. So you can use request /response in these methods for only what they do, one purpose.
Now execute is a generic method. It can do much more than just create, delete and update. In addition to the common methods (create, update and delete), you can use the IOrganizationService.Execute method to execute messages that are not exposed as methods. The Execute method takes a message request class as a parameter and returns a message response class.
There are more than 200 messages apart from create, delete and update. If you start using each individual method, then there will more than 200 methods. So Microsoft has created individual methods for common methods and rest can be done by one generic execute method. You can even create, delete and update using execute method.
I advise use create, update, delete methods when doing that. Use execute for rest messages like associate, disassociate, etc.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
- Navržen jako odpověď Ashish Mahajan Australia (Architect) 18. dubna 2012 19:41
- Označen jako odpověď Jamie MileyMVP, Moderator 19. dubna 2012 13:12
-
19. dubna 2012 13:05Thanks for your response! Why should we use for create, update, delete methods for their specific functions and execute for rest messages like associate, disassociate, etc.
-
19. dubna 2012 13:09
Hi Srikanth,
That is because Microsoft has not created separate method for every use. Create/delete/update have their own methods. But many messages don't have their corresponding methods and hence we have to use execute. You don't have to use create/update/delete. It is just because if I am creating an entity record, then its easier for me to just use create.
I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.
Ashish Mahajan, CRM Developer, CSG (Melbourne)
My Personal Website: http://www.ashishmahajan.com
My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm
My Twitter: https://twitter.com/#!/ashishmahajan74My Linkedin: 
- Navržen jako odpověď Ashish Mahajan Australia (Architect) 19. dubna 2012 13:09
- Označen jako odpověď Jamie MileyMVP, Moderator 19. dubna 2012 13:12
-
19. dubna 2012 13:12Moderátor
They could add them in the future also. The rest API for CRM is relatively new and still only works for web resources inside the application.Jamie Miley
Check out my about.me profile!
http://mileyja.blogspot.com
Linked-In Profile
Follow Me on Twitter!- Navržen jako odpověď Jamie MileyMVP, Moderator 19. dubna 2012 13:12
- Označen jako odpověď Jamie MileyMVP, Moderator 19. dubna 2012 13:12