I’m not familiar at all with creating an Order from a Quote, but it seems that a lot of the time the XYZChanging methods (like the OrderDtlQuoteLineChanging method you’re using) have a check for something actually changing…
Does it make a difference if the RowMod of the Quote line is empty vs "U"?
In the trace for both OrderDtlGetNewFromQuote and OrderDtlQuoteLineChanging the RowMod in the response is ‘A’…
That is likely because it’s the order tableset and we are adding a row.
Often service names (and descriptions) I’ve found are misleading,
I think it this case OrderDtlQuoteLineChanging means that in the OrderDtl record the QuoteNum field and QuoteLine field have been updated
The trace shows that also, in OrderDtlGetNewFromQuote they are both zero, but after OrderDtlQuoteLineChanging they have been changed to the correct quotenum and quoteline
You probably need the OrderHed to be created (or lookup up first) in the table set.
In the trace, network, response for the rest calls when using the epicor menu, there is no orderhed populated in the tableset
First, use the trace while doing what you want in the UI - you goal is to emulate the code in the function. That is the best way you can start.
Quickest way is to use Quote.CreateOrder - this is similar to generating an SO from quote entry.
For more options, use the SalesOrder BO. Add a header, loop through all quote lines and add the order lines you want.
That is exactly what i did (use epicor and tracing).
Creating an order from quote is not an option because we are trying to add lines to existing orders.
I am using the sales order BO and looping thru the lines, as rest does.
I have not populated the order header to the TS because the trace from epicor shows it as empty for both calls that have it
I’m going to try to replicate what epicor is doing in postman by copying the payloads on each call
I’ve had the same request at a couple of companies I’m no longer with… If you want to create a Kinetic Idea for this, I’ll vote for it ![]()
Jenn
Except … what ID would you be using? If there were no Sales Orders in you whole database, you would still need to be able to create a new one.
I can see using GetNewOrderHed to create an empty dataset - but even with that one you have to pass in an empty tableset
New line from quote is only available from an existing order (it’s on the order detail menu)
I think @utaylor and I have a thread with the relevant bits somewhere.
Dang, I can’t seem to find it
Let me go look, I can’t remember if there is code in there or not.
It’s not going to be exactly what you need, but maybe it will help.
If not, I might can help this afternoon if y’all haven’t worked it out by then.
@klincecum @jwphillips @JennL @dragos @markdamen @jkane @dcamlin
Eureka…got it figured out. thanks for all the helpful questions/thoughts
After creating each call in Postman (sw tool) and using the response for the next request and experimenting with some options I ended up with thie relevant code below:
- function input params, iOrderNum, iQuoteNum, iQuoteLine
- it was necessary to first call GetByID to create the Tableset
- before the call to OrderDtlQuoteLineChanging, need to find the last record (new line) and set the QuoteNum and QuoteLine
- I haven’t totally checked out the GetQuoteQty resulting tableset, I have a feeling I might need to move numbers to the order release(s) records
- lastly, call Update to save
{
Erp.Tablesets.SalesOrderTableset orderTS = orderSvc.GetByID(iOrderNum);
orderSvc.OrderDtlGetNewFromQuote(ref orderTS, iOrderNum);
int newLineIndex = orderTS.OrderDtl.Count - 1;
orderTS.OrderDtl[newLineIndex].QuoteNum = iQuoteNum;
orderTS.OrderDtl[newLineIndex].QuoteLine = iQuoteLine;
orderSvc.OrderDtlQuoteLineChanging(iQuoteNum, iQuoteLine, ref orderTS);
bool morePages = true;
while (morePages)
{
orderSvc.GetQuoteQty(iQuoteNum, iQuoteLine, 50, 0, out morePages);
}
orderSvc.Update(ref orderTS);
});

@JennL I’ll likely put in an Epicor Idea for this as you suggested
One note in case you want to do something like this…
my plan for how the users will specify which quote lines to pull, at least for now, is to simply use a textbox where they enter comma separated list of individual numbers and/or ranges, similiar to printing pages, e.g. 1,3,7-10,15 in other apps, and do the create order line from quote in a loop based on that.
I’ve used that once already for specifying multiple order lines to create jobs for, (we have our job creation process automated but until recently was one line at a time)
It’s a longer running process though so I have a function that calls the ScheduleAgent and when it’s done I generate an email to the user with the results for each line
*** edited, had “specify which quote line”
corrected to “specify which quote lines” ***
Great work! Now start working on a utility that allows us to renumber lines! ![]()