Share via


Sample: Create and associate knowledge base record to incident

 

Applies To: Dynamics CRM 2015

This sample demonstrates how to create a knowledge base record instance, and associate it with an Incident instance. For more information about the feature that this sample demonstrates, see Integrate Microsoft Dynamics CRM with Parature.

This sample is for Microsoft Dynamics CRM Online 2015 Update 1. This is available to download from Parature Integration: Create and associate knowledge base record to incident.

Prerequisites

  1. Have access to a Microsoft Dynamics CRM Online 2015 Update 1 organization, and Parature knowledge management integration must be enabled for the CRM organization. More information: TechNet: Connect Microsoft Dynamics CRM to Parature knowledge base.

  2. Download the ParatureIntegration Visual Studio project.

  3. Open the ParatureIntegration Visual Studio project and install Microsoft.CrmSdk.CoreAssemblies version 7.1.0-preview NuGet Package. See Install NuGet packages later for instructions.

    After you install the NuGet packages, see Run the sample for instructions on how to run the sample and what to expect.

In This Topic

What this sample does

Install NuGet packages

Run the sample

What this sample does

  1. The CreateandAssociateKBRecordtoIncident class Run method calls the CheckCRMVersion method, which detects if you are running the appropriate version of CRM for the sample.

  2. The CheckKnowledgeManagementStatus method checks if the knowledge management is enabled for the Incident entity.

  3. The CreateRequiredRecords method creates the required records for the sample: a sample account and an incident record.

  4. Creates a sample KnowledgeBaseRecord record.

  5. Associates the sample KnowledgeBaseRecord record with the Incident record created earlier, checks if the association is successful, and then disassociates the records.

  6. Finally, the DeleteRequiredRecords method prompts you to delete the entity records created during the sample run:

    1. Type y, and press ENTER to delete the entity records from your organization.

    2. Type n, and press ENTER to leave the entity records in your organization. You will have to manually delete the entity records later if you want to return to the original state.

Install NuGet packages

Use the following steps to install the required assemblies for this sample:

  1. Download this sample and extract the files.

  2. Navigate to the C# folder and open the ParatureIntegration.sln file using Visual Studio.

  3. In Visual Studio, right-click the ParatureIntegration project and chose Manage NuGet Packages.

  4. For the preview release, make sure to choose Include Prerelease rather than Stable Only in the search criteria. Then search for “Microsoft Dynamics CRM 2015 SDK core assemblies”. Make sure you select the 7.1.0-preview version.

  5. Click Install. You’ll need to accept the license terms to complete installing this package.

Run the sample

  1. In Visual Studio, with the solution open and the necessary NuGet packages installed, press F5.

  2. If you have not previously run one of the Microsoft Dynamics CRM managed code samples before, you’ll need to enter information to run the code, otherwise enter the number for one of the CRM servers you have previously set up.

    Prompt

    Description

    Enter a CRM server name and port [crm.dynamics.com]

    Type the name of your Microsoft Dynamics CRM server. The default is Microsoft Dynamics CRM Online (crm.dynamics.com) in North America.

    Example:
    crm5.dynamics.com

    Is this organization provisioned in Microsoft online services (y/n) [n]

    Type y if this is a Microsoft online services provisioned organization. Otherwise, type n.

    Enter domain\username

    Type your Microsoft account.

    Enter password

    Type your password. The characters will show as “*” in the window. Your password is securely saved in the Microsoft Credential Manager for later reuse.

    Specify an organization number (1-n) [1]

    From the list of organizations shown that you belong to, type the corresponding number. The default is 1, indicating the first organization in the list.

  3. The sample will perform the operations described in What this sample does and may prompt you with additional options.

  4. When the sample is complete, press ENTER to close the console window.

See Also

Integrate Microsoft Dynamics CRM with Parature

© 2016 Microsoft. All rights reserved. Copyright