Create new order line from quote via function

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:

        
    // 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

1 Like

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

Because they often want a subset of lines, not all

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

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??

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

Gotcha…
Reverse That Do It Again GIF - Reverse That Do It Again Return - Discover & Share GIFs

2 Likes

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

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

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

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

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

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

1 Like

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

Thanks !

1 Like

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

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

Only one qty break per line (default)

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

1 Like

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

2 Likes

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

1 Like