pricerc wrote:Customer has some PHP code lurking from Jiwa 6 days that is writing 'shopping cart' orders as XML to IM_ImportQueue.
There was some limitation (too lazy to look it up) that prevented them doing the same when the orders were being converted from a quote.
We're now reviewing if this is still a problem.
I guess my main question is: can I just add the SourceQuoteNo, SourceQuoteID, and/or SourceQuoteHistoryID to the XML?
Or is there something else that I need to do?
I don't think we have a way of importing a sales order and making it appear that it was created from a quote. Exporting the XSD's (from the sales order form - utilities tab) and I can see that there is no fields for the source quote, so you certainly can't do this by importing sales order XML right now - not even if you added SourceQuoteNo, SourceQuoteID, and/or SourceQuoteHistoryID to the XML. If we wanted to do that, what you propose is backwards to what normally happens - we start from a quote and make that a sales order and set the sourcequote fields in the order for you.
The crux of the problem is that the XML imports were for importing documents, and what you want sounds like a process - converting a sales order into a quote.
pricerc wrote:A related question would be: If we converted to using the REST API (which I'd like to do), will we be able to use the same call to create both 'shopping cart' and 'from quote' sales orders?
a POST to /SalesQuotes/{QuoteID}/MakeOrder makes a sales order from a quote,
a POST to /SalesOrders creates a sales order
You can't do it from the same route out of the box, but you can easily add your own route which branches off based on a field in the body to call one of the two standard services. Our standard DTO we have for sales orders doesn't have the SourceQuote fields - but that's as easy as inherit from our sales order DTO, add your own field(s) and your new POST route + service accepts your new extended DTO, looks at the new field and then either calls our standard sales order POST to create a sales order, or the POST to /SalesQuotes/{QuoteID}/MakeOrder to make the sales order from the quote.