# Create new order line from quote via function

**URL:** <https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085>\
**Category:** Kinetic ERP\
**Tags:** rest\
**Created:** [June 21, 2024, 5:47pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085 "2024-06-21T17:47:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 5:47pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/1 "2024-06-21T17:47:03Z")

</div>

We want to be able to have users create multiple order lines from a quote by specifying the quote lines.

I am implementing the backend part of it in functions using REST calls on Erp.BO.SalesOrderSvc.

Looking at debug tools and tracing when doing one thru the UI shows the following are required and have been implemented in my function (code snippet further below):

- Create new SalesOrder tableset
- SalesOrderSvc.OrderDtlGetNewFromQuote(orderNum, ref orderTS)  
order dataset is returned with a new line
- SalesOrderSvc.OrderDtlQuoteLineChanging(quoteNum, quoteLine, ref orderTS)  
updates the order line in the dataset with the quote line data
- SalesOrderSvc.GetQuoteQty(quoteNum, quoteLine)  
returnObj is the quantity data for the order release

First service call works fine, but OrderDtlQuoteLineChanging throws exception “Invalid Quote Line”, there is no inner exception.

I do not get an error when I use the same order/quote combination in Epicor UI.

Here is the relevant code:

```auto
        
    // need an OrderHed tableset for GetNewOrderDtlFromQuote
    Erp.Tablesets.SalesOrderTableset orderTS = new Erp.Tablesets.SalesOrderTableset();
       
    this.CallService<Erp.Contracts.SalesOrderSvcContract>( orderSvc =>
    {
        orderSvc.OrderDtlGetNewFromQuote(ref orderTS, iOrderNum);
        
        orderSvc.OrderDtlQuoteLineChanging(iQuoteNum, iQuoteLine, ref orderTS);
     
        bool morePages = false;
        orderSvc.GetQuoteQty(iQuoteNum, iQuoteLine, 500, 0, out morePages);

    });
    

```

Any thoughts on error cause ?

thanks

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [June 21, 2024, 5:48pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/2 "2024-06-21T17:48:24Z")

</div>

May I ask why you are not using the Create Order From Quote functionality?

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 5:49pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/3 "2024-06-21T17:49:19Z")

</div>

Because they often want a subset of lines, not all

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [June 21, 2024, 5:49pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/4 "2024-06-21T17:49:57Z")

</div>

You don’t have to select all lines when using the process. You can just select the ones you want.

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [June 21, 2024, 5:50pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/5 "2024-06-21T17:50:09Z")

</div>

You can PULL from the SO Entry instead of PUSH from Quote Entry. But I can’t remember, you may have to do one at a time??

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [June 21, 2024, 5:50pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/6 "2024-06-21T17:50:42Z")

</div>

Pushing from Quote allows you to select lines. Pulling from quote is all or nothing.

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [June 21, 2024, 5:51pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/7 "2024-06-21T17:51:32Z")

</div>

Gotcha…  
 ![Reverse That Do It Again GIF - Reverse That Do It Again Return - Discover & Share GIFs](https://media.tenor.com/lOdJ5jT5X4cAAAAM/willy-wonka-wonka.gif)

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 5:53pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/8 "2024-06-21T17:53:13Z")

</div>

> [@dcamlin](#):
>
> But I can’t remember, you may have to do one at a time??

Yes, one at a time, my function will loop thru the specified lines

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [June 21, 2024, 5:54pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/9 "2024-06-21T17:54:18Z")

</div>

Are you saying you want to create multiple SO lines from the same Quote line?

---

<div class="post-metadata">

**Author:** ![dcamlin](https://www.epiusers.help/user_avatar/www.epiusers.help/dcamlin/32/57759_2.png) [@dcamlin](https://www.epiusers.help/u/dcamlin)\
**Post date:** [June 21, 2024, 5:54pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/10 "2024-06-21T17:54:23Z")

</div>

Maybe evaluate the Quote “PUSH” trace and see what its doing then. The functionality is there… just not where you want it.

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 5:55pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/11 "2024-06-21T17:55:49Z")

</div>

> [@jkane](#):
>
> Pushing from Quote allows you to select lines. Pulling from quote is all or nothing.

I am implementing this for Kinetic-Web, how do I select lines when pushing from quote ? (I’m missing something in the UI likely) if that’s true that would be great

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 5:58pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/12 "2024-06-21T17:58:23Z")

</div>

If you look at the QuoteSvc.CreateOrderFromQuote service, it does not allow specifying line numbers, that would imply to me it’s not the case

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [June 21, 2024, 5:59pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/13 "2024-06-21T17:59:08Z")

</div>

From the Quote you want to turn into a Sales Order, in the overflow menu there is Create Sales Order. Select that and you will get a slide out. There is an Order Worthy column that you use to selecte the lines you want on the SO.

![image](https://www.epiusers.help/uploads/default/original/3X/1/d/1dbe42f21f638fe09a7a043e5938f01030b94ef5.png)

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 6:00pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/14 "2024-06-21T18:00:19Z")

</div>

I did see that column, but not what I thought it was for but I will try it out

Thanks !

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 6:07pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/15 "2024-06-21T18:07:06Z")

</div>

> [@jkane](#):
>
> There is an Order Worthy column that you use to selecte the lines you want on the SO.

Very odd, on a 3 line order I selected line 1 and 3.  
The resulting order had line 1 correct but for order line 2 it took the unit price from line quote line 2 and the qty from quote line 3

I’ll have to talk to my project manager, but another reason to use pull instead of push would be if I have an existing order and want to add lines to it

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [June 21, 2024, 6:09pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/16 "2024-06-21T18:09:12Z")

</div>

Do you have breaks in your quotes? If you do, you have to select the correct break to have it come over correctly.

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 6:11pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/17 "2024-06-21T18:11:20Z")

</div>

Only one qty break per line (default)

---

<div class="post-metadata">

**Author:** ![jkane](https://www.epiusers.help/user_avatar/www.epiusers.help/jkane/32/57624_2.png) [@jkane](https://www.epiusers.help/u/jkane)\
**Post date:** [June 21, 2024, 6:12pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/18 "2024-06-21T18:12:02Z")

</div>

Sounds like there might be a bug in Kinetic then. It worked fine in 10.

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 6:15pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/19 "2024-06-21T18:15:28Z")

</div>

Yeah, just talked to my PM, there is a glitch we found and reported that is related to the quanity break value coming from the wrong line

---

<div class="post-metadata">

**Author:** ![datadaddy](https://www.epiusers.help/user_avatar/www.epiusers.help/datadaddy/32/55900_2.png) [@datadaddy](https://www.epiusers.help/u/datadaddy)\
**Post date:** [June 21, 2024, 6:16pm UTC](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085/20 "2024-06-21T18:16:57Z")

</div>

So anyway… **I’m back to my original issue, because** they want this feature because we often do projects that last a while, and want to be able to add multiple lines from a quote to an **existing** order

[Next page](https://www.epiusers.help/t/create-new-order-line-from-quote-via-function/116085.md?page=2)
