March 5, 20241 yr I have a query which pulls down a sales order which has existing line items. After the order is processed, I'd like to add a new line item to the order. (ex: adding the shipping cost) I seem to have wrongly assumed I can use SalesOrderMod and then SalesOrderLineMod without a TxnID to add a new line. It seems SalesOrderAdd would be wrong since the SalesOrder already exists. Can anyone help with proper syntax?
March 5, 20241 yr You're missing the EditSequence element, which is required. You need to set SalesOrderLineMod::TxnID to -1 to add a new LineItem to your SalesOrder. It's been awhile since I last did this: you may need to loop first to include the TxnID of the already created LineItems in your Mod request. HTH! Geoffrey Gerhard Creative Solutions Incorporated 14000 Creekside Drive Matthews, NC 28105 704.814.6852 Edited March 5, 20241 yr by Geoffrey Gerhard
March 5, 20241 yr Author Hi Geoffrey - Thanks for the reply! My understanding was using -1 deletes all the previous line items. Worst-case I suppose I can store exisiting line items, then delete all and add back but I am not QB saavy and worried there could be inventory or some other ramifications of delete. (discounts, tax, etc.) I'll check EditSequence!
March 5, 20241 yr Set the IncludeLineItems to true in your SalesOrderQueryRequest, which you'll need to get the current EditSequence value, and you'll have the SalesOrderLineMod::TxnID values in the Response. Geoffrey Gerhard Creative Solutions Incorporated 14000 Creekside Drive Matthews, NC 28105 704.814.6852 Edited March 5, 20241 yr by Geoffrey Gerhard
Create an account or sign in to comment