Introduction

This sample is a custom extension to the CrmSvcUtil.exe program that ships in the Dynamics CRM 2013 SDK. The purpose of this program is to generate C# or VB source code containing early-bound entity types and option set types from the metadata of your CRM server. This code can then be included in your mobile app projects. This enables you to make use of both out-of-box and any custom or customized entities in your code.

Building the Sample

To build the program, follow these steps.

  1. In the C# folder, load the CrmSvcMobileUtil.sln solution file into Visual Studio 2013 or later.
  2. Open the FilterService.cs file, and then at line 45 or so, add any entities you want to generate an early-bound class for, or remove those that you do not want.
  3. Obtain the CrmSvcUtil.exe program and the Microsoft.Xrm.Sdk.dll assembly from the Bin folder of the CRM 2013 or 2015 SDK. You can download the SDK from http://msdn.microsoft.com/en-us/dynamics/crm/dn467921.aspx.
  4. Add references for CrmSvcUtil.exe and Microsoft.Xrm.Sdk.dll to the project.
  5. Press F6 to build the program.

Running the Program

For information on how to run the program, see the SDK topic: Create early bound entity classes with the code generation tool (CrmSvcUtil.exe).

Here is an example command that generates actions:

CrmSvcUtil.exe /codecustomization:"Microsoft.Crm.Sdk.Samples.CodeCustomizationService,CrmSvcMobileUtil" /codewriterfilter:"Microsoft.Crm.Sdk.Samples.FilteringService,CrmSvcMobileUtil" /url:https://<mydomain>.api.crm.dynamics.com/XRMServices/2011/Organization.svc /username:<username> /password:<password> /out:<filename> /namespace:<namespace> /generateActions

Make sure you substitute your appropriate values for the terms that are shown between < and > symbols.

Important Notes

More Information

For more information about writing an extension to the CrmSvcUtil program, see Create extensions for the code generation tool.

Change History

Version 1.0

Version 1.1