Tuesday, May 3, 2016
Convert a Sales Order to an Invoice directly using C# code
In the sales process a sales order would be converted to an invoice. Most of the fields in both entities are the same.
So it would be easy for us to create an invoice from a sales order directly by assigning each sales order field to an invoice field. This is fine, but would be a tedious task as for some projects you wouldn’t all the fields in the sales order filled in. Is there an easy way for us to achieve this?
Yes, there is. There is an OOTB functionality which has been given, in which a sales order can be converted to an invoice with few lines of code. The code is given below.
ConvertSalesOrderToInvoiceRequest convertOrderRequest =
SalesOrderId = Sales Order Id,
ColumnSet = new Microsoft.Xrm.Sdk.Query.ColumnSet(true)
ConvertSalesOrderToInvoiceResponse convertOrderResponse = (ConvertSalesOrderToInvoiceResponse)db.Execute(convertOrderRequest);
Invoice invoice = (Invoice)convertOrderResponse.Entity;
at May 03, 2016
There are occasions where we need to retrieve working days and working times of a resource in Dynamics grammatically. This is quite possible...
There is a bit of change in CRM 2011 than CRM 4. The code is below. Microsoft.Xrm.Sdk. EntityReference Moniker1 = new Microsoft.Xrm.S...
When you create a new security role from scratch and then assign only that role to a system user and when you log to the CRM site you might ...
Error message “User does not have send-as privilege.” when sending emails programmatically in CRM 2011We were working on sending emails programmatically using CRM and all were working fine. Suddenly we got this error when we tried to send an ...