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

ConvertProductToKit 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

Converts a product to a kit.

The relevant classes are specified in the following table.

TypeClass
RequestConvertProductToKitRequest
ResponseConvertProductToKitResponse
Entityproduct

Remarks

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

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

Example

The following code example demonstrates how to convert a product to a kit.

[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 the Request
ConvertProductToKitRequest convert = new ConvertProductToKitRequest();
// ProductId is the Guid of the product to be converted
convert.ProductId = new Guid("b050f053-6968-dc11-bb3a-0003ffbad37a");

// Execute the Request
ConvertProductToKitResponse converted = (ConvertProductToKitResponse)service.Execute(convert);
[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 the Request
Dim convert As New ConvertProductToKitRequest()
' ProductId is the Guid of the product to be converted
convert.ProductId = new Guid("b050f053-6968-dc11-bb3a-0003ffbad37a");

 ' Execute the Request
 Dim converted As ConvertProductToKitResponse = CType(service.Execute(convert), ConvertProductToKitResponse)

See Also

Concepts

Reference


© 2010 Microsoft Corporation. All rights reserved.


Show:
© 2015 Microsoft