Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

GetHeaderColumnsImportFile Message (CrmService)

banner art

[Applies to: Microsoft Dynamics CRM 4.0]

Find the latest SDK documentation: CRM 2015 SDK

Works for all deployment typesWorks online only

Retrieves the source-file column headings, or system-generated column headings, if the source file does not contain column headings.

The relevant classes are specified in the following table.

TypeClass
RequestGetHeaderColumnsImportFileRequest
ResponseGetHeaderColumnsImportFileResponse
Entityimportfile
Optional ParametersRequestIdOptionalParameter

Remarks

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

To perform this action, the caller must have access rights on the import file entity instance. For a list of required privileges, see GetHeaderColumnsImportFile Privileges.

Example

The following sample code shows how to use the GetHeaderColumnsImportFile message. For a complete sample, download the SDK sample code and look at SDK\Server\FullSample\DataMigration.

// 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;

// Retrieve the header columns used in the import file.
GetHeaderColumnsImportFileRequest headerColumnsRequest = new GetHeaderColumnsImportFileRequest();
headerColumnsRequest.ImportFileId = new Guid("1DCDEE97-35BB-44BE-8353-58BC36592656");
GetHeaderColumnsImportFileResponse headerColumnsResponse = (GetHeaderColumnsImportFileResponse)service.Execute(headerColumnsRequest);

// Ouput the header columns.
int columnNum = 1;
foreach(string headerName in headerColumnsResponse.Columns)
{
   Console.WriteLine("Column[" + columnNum.ToString() + "] = " + headerName);
   columnNum++;
}

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2015 Microsoft