Hello,
I'm working on a sales order integration with econnect and am having issues updating transactions with serial numbers or manually set taxes... Any suggestions?
Also, I am using the .net classes to run the econnect integrations, is it faster to run the stored procedures instead since I'm always connected and close to SQL anyway? If so, how do you do an sop transaction with all its parts? do you insert the header first and then the lines, serials, payments, taxes etc after? wont econnect say that the numbers are out if you insert the header without lines?
So far I have delt with serial numbers by deleting all the relevant lines from SOP10201 and updating SOP10200 right before I run my update through econnect, then econnect puts them all back thinking they are newly selected and it works great.
Dim SqlSerialDelete As String = <string> IF EXISTS(SELECT LNITMSEQ FROM SOP10200 WHERE SOPNUMBE='{0}' AND SOPTYPE={1} AND LNITMSEQ={2} AND CMPNTSEQ={3} AND ITEMNMBR='{4}') BEGIN UPDATE SOP10200 SET QTYFULFI=0 WHERE SOPNUMBE='{0}' AND SOPTYPE={1} AND LNITMSEQ={2} AND CMPNTSEQ={3} AND ITEMNMBR='{4}' IF EXISTS(SELECT SERLTNUM FROM SOP10201 WHERE SOPNUMBE='{0}' AND SOPTYPE={1} AND LNITMSEQ={2} AND CMPNTSEQ={3} AND ITEMNMBR='{4}' AND SERLTNUM='{5}') BEGIN DELETE FROM SOP10201 WHERE SOPNUMBE='{0}' AND SOPTYPE={1} AND LNITMSEQ={2} AND CMPNTSEQ={3} AND ITEMNMBR='{4}' AND SERLTNUM='{5}' IF EXISTS(SELECT SERLNSLD FROM IV00200 WHERE ITEMNMBR='{4}' AND LOCNCODE='{6}' AND SERLNMBR='{5}') UPDATE IV00200 SET SERLNSLD=0 WHERE ITEMNMBR='{4}' AND LOCNCODE='{6}' AND SERLNMBR='{5}' END END </string>.Value Dim strSQL As Atring = String.Format(SqlSerialDelete, SOPNUMBE, SOPTYPE, LNITMSEQ, CMPNTSEQ, ITEMNMBR, SERLTNUM, LOCNCODE)
The "Update manual tax" issue...
If I set the tax values manually and insert with econnect it works.
Then, if I update the same transaction with the same data (no changes) it fails saying it cant update manually set taxes. However, If generate the taxes to be the same as they would be if econnect generated them (following all the rules) then it will not error.
SO far my best solution would be to update SQL after econnect does, and set the (one specific) taxes manually. However, starting to code this procedure I have quickly realized this is going to be a bit of a daunting task... Particularly updating all the totals to reflect the changed tax amount, then thinking about it, what if the document is fully paid, but the auto tax says its more than what it should be when its manual, I guess this will be better than the other way, econnect probably wont allow a document to have more payment then docamount....
Is there a procedure I can run outside of GP that will automatically update an SOP transactions totals and distributions by actually doing the math?
ARG, suggestions? discussion?
*This post is locked for comments