Sample: Create and associate knowledge base record to incident
Applies To: Dynamics 365 (online), Dynamics 365 (on-premises), Dynamics CRM 2016, Dynamics CRM Online
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 Use Parature knowledge in Dynamics 365.
This sample is for Microsoft Dynamics CRM Online 2015 Update 1 and Microsoft Dynamics 365 (on-premises) . This is available to download from Parature Integration: Create and associate knowledge base record to incident.
Prerequisites
Have access to a Microsoft Dynamics CRM Online 2015 Update 1 or Microsoft Dynamics 365 organization, and Parature knowledge management integration must be enabled for the Dynamics 365 organization. More information: TechNet: Connect Microsoft Dynamics CRM to Parature knowledge base.
Download the ParatureIntegration Visual Studio project.
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
The CreateandAssociateKBRecordtoIncident class Run method calls the CheckCRMVersion method, which detects if you are running the appropriate version of Dynamics 365 for the sample.
The CheckKnowledgeManagementStatus method checks if the knowledge management is enabled for the Incident entity.
The CreateRequiredRecords method creates the required records for the sample: a sample account and an incident record.
Creates a sample KnowledgeBaseRecord record.
Associates the sample KnowledgeBaseRecord record with the Incident record created earlier, checks if the association is successful, and then disassociates the records.
Finally, the DeleteRequiredRecords method prompts you to delete the entity records created during the sample run:
Type y, and press ENTER to delete the entity records from your organization.
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:
Download this sample and extract the files.
Navigate to the C# folder and open the ParatureIntegration.sln file using Visual Studio.
In Visual Studio, right-click the ParatureIntegration project and chose Manage NuGet Packages.
For the preview release, make sure to select 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.
Click Install. You’ll need to accept the license terms to complete installing this package.
Run the sample
In Visual Studio, with the solution open and the necessary NuGet packages installed, press F5.
If you have not previously run one of the Microsoft Dynamics 365 managed code samples before, you’ll need to enter information to run the code, otherwise enter the number for one of the Dynamics 365 servers you have previously set up.
Prompt
Description
Enter a Dynamics 365 server name and port [crm.dynamics.com]
Type the name of your Microsoft Dynamics 365 server. The default is Microsoft Dynamics 365 (online) (crm.dynamics.com) in North America.
Example:
crm5.dynamics.comIs 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.
The sample will perform the operations described in What this sample does and may prompt you with additional options.
When the sample is complete, press ENTER to close the console window.
See Also
Use Parature knowledge in Dynamics 365
Microsoft Dynamics 365
© 2016 Microsoft. All rights reserved. Copyright