nrg software Posted March 5 Posted March 5 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?
Geoffrey Gerhard Posted March 5 Posted March 5 (edited) 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 by Geoffrey Gerhard
nrg software Posted March 5 Author Posted March 5 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!
Geoffrey Gerhard Posted March 5 Posted March 5 (edited) 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 by Geoffrey Gerhard
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now