This documentation is archived and is not being maintained.

Starting the Import Operation

Dynamics
banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

The entity customizations or translations are imported into Microsoft Dynamics CRM from an XML file. The following example shows how to start the import by using the ImportXmlWithProgress message. You have to supply a unique import job ID in the ImportXmlWithProgressRequest.ImportJobId property and specify the customizations that you want to import in the ImportXmlWithProgressRequest.ParameterXml property.

Example

[C#]
// Create a customization XML document by exporting one.
ExportXmlRequest exportRequest = new ExportXmlRequest();
exportRequest.ParameterXml = 
    @"<importexportxml>
        <entities>
            <entity>account</entity>   
        </entities>
        <nodes/>
        <securityroles/>
        <workflows/>
        <settings/>
    </importexportxml>";
ExportXmlResponse exportResponse = (ExportXmlResponse) service.Execute(exportRequest);
  
// Create an ImportXmlWithProgress request.
ImportXmlWithProgressRequest request = new ImportXmlWithProgressRequest();

// Set the customization XML to import.
request.CustomizationXml = exportResponse.ExportXml;

// Set the ParameterXml property, which defines what customizations to import.
request.ParameterXml =
    @"<importexportxml>
        <entities>
            <entity>account</entity>   
        </entities>
        <nodes/>
        <securityroles/>
        <workflows/>
        <settings/>
    </importexportxml>";

// Give the request a unique import Job ID.
request.ImportJobId = Guid.NewGuid();

// Execute the request. 
ImportXmlWithProgressResponse response = (ImportXmlWithProgressResponse) service.Execute(request);

See Also

Other Resources


© 2010 Microsoft Corporation. All rights reserved.


Show: