You process multiple types of quotes using a related No. Series. However, when you convert your quote to a Sale Order, the Sales Order will be created based on the default No. Series of Sales Orders according to your “Sales and Receivable Setup”.
How to you keep the Sales Order in a separate No. Series based in the type of Quote that you originally created?
Here is a little trick with minimal coding that will help you achieve your goal. In the example we’ll use “Type 2 Quote” and “Type 2 Sales Order” as the alternates. This represents a second type of Quote and its desired related Sales Orders.
- Insert a new No Series. This will be the No. Series of the “Type 2 Sales Orders” you would like to use for “Type 2 Quotes”.
- Set the relationship to the Default No. Series that is currently being uses as Sales Orders.
- Add a new field to the No. Series (table 308) and (page 456) called “Convert to No. Series.” as Code 10 and set the TableRelation to the “No. Series” table.
- On the “Quote Type 2” No. Series record, populate “Convert To Nos.” field with the No. Series of ”Sales Order Type 2”.
- In the “OnRun” trigger of CU86 “Sales-Quote to Order” insert the follow code for “assign Order No. Series based on originating quote No. Series”:
OnRun(VAR Rec : Record "Sales Header")
TESTFIELD("Document Type","Document Type"::Quote);
Cust.GET("Sell-to Customer No.");
CALCFIELDS("Amount Including VAT");
SalesOrderHeader := Rec;
IF GUIALLOWED AND NOT HideValidationDialog THEN
SalesOrderHeader."Document Type" := SalesOrderHeader."Document Type"::Order;
// xxx.xx.xx --> assign Order No. Series based on originating quote No. Series
IF "No. Series" '' THEN BEGIN
IF NoSeries."Convert To Nos." '' THEN
SalesOrderHeader. "No. Series" := NoSeries."Convert To Nos.";
Now when the alternate No Series is used to create “Quote Type 2” Quotes, the converted Sales Orders will use the new “Sales Order Type 2” No. Series.
You can also use this same logic in other areas. Just don’t forget to set the Relationship of the No. Series or you will always be populating the new record with the default No. Series when you intended on it being overridden.