Skip to content

Latest commit

 

History

History
54 lines (37 loc) · 2.18 KB

sample-initialize-record-existing-record.md

File metadata and controls

54 lines (37 loc) · 2.18 KB
title description keywords ms.date ms.custom ms.topic applies_to ms.assetid author ms.author ms.reviewer ms.suite ms.tgt_pltfrm topic-status search.audienceType
Sample: Initialize a record from an existing record (Developer Guide for Dynamics 365 Customer Engagement)| MicrosoftDocs
This sample shows how to use the IOrganizationService.InitializeFromRequest message to create new records from an existing record
01/08/2020
sample
Dynamics 365 Customer Engagement (on-premises)
1d0d6df3-e905-4b63-beaa-3f72f73bfa17
JimDaly
jdaly
pehecke
Drafting
developer

Sample: Initialize a record from an existing record

This sample shows how to use the IOrganizationService.InitializeFromRequest message to create new records from an existing record. You can download the sample from here.

[!includecc-sample-note]

How to run this sample

[!includecc-how-to-run-samples]

What this sample does

The IOrganizationService.InitializeFromRequest message is intended to be used in a scenario where it contains the data that is needed to initialize a new record from an existing record.

How this sample works

In order to simulate the scenario described in What this sample does, the sample will do the following:

Setup

  1. Checks for the current version of the org.
  2. The CreateRequiredRecords method creates any entity records that this sample requires.

Demonstrate

  1. The InitializeFromRequest method creates the request and set properties for the request object.
  2. The InitializeFromResponse method executes the request.

Clean up

Display an option to delete the sample data that is created in Setup. The deletion is optional in case you want to examine the entities and data created by the sample. You can manually delete the records to achieve the same result.

[!INCLUDEfooter-include]