Sunday, December 7, 2014

CRM 2015 SDK - Get organization details from Organization service

A few weeks ago, I was working on a plug-in for a Microsoft Dynamic CRM 2013 project and wanted to add organization-specific logic to it. In CRM version 2013, Microsoft did not provide a way to get organization details using the Organization.svc service endpoint but in CRM 2015 Microsoft added this capability with RetrieveCurrentOrganizationRequest and related classes. This allows for more adaptable code in plug-ins, workflow activities and other applications. For example, you might want to call a different Web API endpoint from a plug-in depending on whether the plug-in is running in production vs. running in a development sandbox instance.