ImportRecordsImport Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment types Works online and offline

Submits an asynchronous job that uploads the transformed data into Microsoft Dynamics CRM.

The relevant classes are specified in the following table.

Type Class
Request ImportRecordsImportRequest
Response ImportRecordsImportResponse
Entity import
Optional Parameters RequestIdOptionalParameter

Remarks

To use this message, pass an instance of the ImportRecordsImportRequest class as the request parameter in the Execute method.

Pass the ID of the associated data import (import) in the ImportId property of the request. The ID of the asynchronous job that runs in the background and uploads the data into Microsoft Dynamics CRM is returned in the AsyncOperationId property of the message response. All import files that are associated with the specified data import (import) are imported.

Example

The following code example shows how to start an import job.

[C#]
// Set up the CRM service.
CrmAuthenticationToken token = new CrmAuthenticationToken();
// You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0; 
token.OrganizationName = "AdventureWorksCycle";
 
CrmService service = new CrmService();
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create an ImportRecordsImport request.
ImportRecordsImportRequest request = new ImportRecordsImportRequest();

// Assign the request the ID of the import we want to begin.
request.ImportId = new Guid("1DCDEE97-35BB-44BE-8353-58BC36592656");

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

[Visual Basic .NET]
' Set up the CRM service.
Dim token As New CrmAuthenticationToken()
' You can use enums.cs from the SDK\Helpers folder to get the enumeration for Active Directory authentication.
token.AuthenticationType = 0
token.OrganizationName = "AdventureWorksCycle";
 
Dim service As New CrmService()
service.Url = "http://<servername>:<port>/mscrmservices/2007/crmservice.asmx";
service.CrmAuthenticationTokenValue = token;
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create an ImportRecordsImport request
Dim request As New ImportRecordsImportRequest()

' Assign the request the id of the import we want to begin
request.ImportId = New Guid("1DCDEE97-35BB-44BE-8353-58BC36592656")

' Execute the request.
Dim response As ImportRecordsImportResponse = CType(service.Execute(request), ImportRecordsImportResponse)

See Also

Concepts

Reference

Tasks

© 2010 Microsoft Corporation. All rights reserved.