SBX - Search With Button

SBX - Forum Post Title

Create SalesOrder from Quote filtering some rows

Microsoft Dynamics CRM Forum

Matteo Veggiari asked a question on 5 Apr 2019 9:41 AM

Question Status

Suggested Answer

Hi

I'm using Microsoft Dynamics CRM 2011.......

When User call the Create Sales Order button from a Quote, then the CRM creates a new Sales Order with same details (rows).

I want to filter some of these rows using plugins and C# (PreSalesOrderCreate?). For example: I want to exclude the rows which have a custom flag (Yes/No option set) "exclude" set to true.

Is there any method to do this?

Thank you very much

Matteo

Reply
Suggested Answer

Hi

I dont think you will be able to change how crm creates Sales Order details from Quote Details.  You wont be able to do in Pre-Create as the sales order rows wont be available at that point.

There are few ways you could achieve what you want.

Yould create a custom workflow activity that Converts the Quote to Order using - ConvertQuoteToSalesOrderRequest

docs.microsoft.com/.../gg327521(v%3Dcrm.8)

In the same CWA, once the ConvertQuoteToSalesOrderRequest is completed, you can get the order and order line items and remove the ones you do not need based on the custom flag. If the custom flag is not in the Order line items, you can definitely add to Order Line item and map it from quote detail.

You can then call this CWA in an Action/Wofklow and execute that on a custom Create Order button on the form.

Reply
Suggested Answer

Hi

I dont think you will be able to change how crm creates Sales Order details from Quote Details.  You wont be able to do in Pre-Create as the sales order rows wont be available at that point.

There are few ways you could achieve what you want.

Yould create a custom workflow activity that Converts the Quote to Order using - ConvertQuoteToSalesOrderRequest

docs.microsoft.com/.../gg327521(v%3Dcrm.8)

In the same CWA, once the ConvertQuoteToSalesOrderRequest is completed, you can get the order and order line items and remove the ones you do not need based on the custom flag. If the custom flag is not in the Order line items, you can definitely add to Order Line item and map it from quote detail.

You can then call this CWA in an Action/Wofklow and execute that on a custom Create Order button on the form.

Reply

SBX - Two Col Forum

SBX - Migrated JS