Export (0) Print
Expand All

ConvertSalesOrderToInvoice Message

CRM 1.2
banner art

Converts a sales order to an invoice.

The relevant classes are specified in the following table.

Type Class
Request ConvertSalesOrderToInvoiceRequest
Response ConvertSalesOrderToInvoiceResponse
Entity salesorder

Remarks

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

Example

The following code example demonstrates how to convert a sales order to an invoice.

[C#]
// Standard CRM Service Setup
CrmService service = new CrmService();
service.Credentials = System.Net.CredentialCache.DefaultCredentials;

// Create the Column Set
// This Column Set holds the set of the attributes to be converted to the invoice
ColumnSet cols = new ColumnSet();
cols.Attributes = new string [] {"name", "accountid", "salesorderid", "invoiceid"};

// Create the Request
ConvertSalesOrderToInvoiceRequest convert = new ConvertSalesOrderToInvoiceRequest();
convert.ColumnSet = cols;
// SalesOrderId is the Guid of the Sales order to be converted
convert.SalesOrderId = 
new Guid("DD58E205-52EB-4C61-9271-8242D75859E3");

// Execute the Request
ConvertSalesOrderToInvoiceResponse converted = (ConvertSalesOrderToInvoiceResponse)service.Execute(convert);

[Visual Basic .NET]
' Set up the CRM Service.
Dim service As New CrmService()
service.Credentials = System.Net.CredentialCache.DefaultCredentials

' Create the Column Set
' This Column Set holds the set of the attributes to be converted to the invoice
Dim cols As New ColumnSet()
cols.Attributes = New String() {"name", "accountid", "salesorderid", "invoiceid"}

' Create the Request
Dim convert As New ConvertSalesOrderToInvoiceRequest()
convert.ColumnSet = cols
' SalesOrderId is the Guid of the Sales order to be converted
convert.SalesOrderId = new Guid("DD58E205-52EB-4C61-9271-8242D75859E3")

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

Related Topics

CrmService Messages


© 2007 Microsoft Corporation. All rights reserved.


Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft