Author Topic: InvoiceMod - TxnLineID  (Read 1533 times)

johnlewisdesign

  • Member
  • *
  • Posts: 81
InvoiceMod - TxnLineID
« on: October 01, 2014, 10:25:18 PM »
Code: [Select]
<InvoiceLineMod><TxnLineID>0</TxnLineID><ItemRef><FullName>NonInventoryCategory</FullName></ItemRef><Desc>2.82 THK</Desc><Quantity>100.00000</Quantity><Rate>0.06720</Rate><SalesTaxCodeRef><FullName>S</FullName></SalesTaxCodeRef></InvoiceLineMod>
Hi I'm trying to modify an already posted invoice but as you can see I can't get the Item's TxnLineID. How would I get it? I can't find any documentation on this.
Thanks!
John

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: InvoiceMod - TxnLineID
« Reply #1 on: October 02, 2014, 05:44:50 AM »
It's prudent, when modifying an Invoice, to send an InvoiceQuery Request to get the latest  EditSequence value. The Response will contain all the LineItem details, including the TxnLineID values.

That said, I never use them because of the overhead--tying those values to the corresponding FMP LineItems is challenging when done after the fact. While you can capture those values from the InvoiceAdd Response, you don't need to because you can pass all LineItems you want to see on the revised Invoice with a TxnLineID value of -1. QB will drop all LineItems that aren't identified by their TxnLineID, and the -1 value is the flag that tells QB to add the InvoicxeLineMod data as a new line.

Assuming your FMP data is the same for those LineItems you are NOT changing, passing their values again with the -1 will result in the Invoice you want. All previous LineItems are dropped and are replaced by either identical or new/modified LineIems.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852

johnlewisdesign

  • Member
  • *
  • Posts: 81
Re: InvoiceMod - TxnLineID
« Reply #2 on: October 13, 2014, 09:47:49 AM »
Hi Geoffrey

I haven't up to this point used the TxnLineID values so they don't exist in the invoice. Pretty sure I tried posting a -1 for these but it didn't play ball once again saying the TxnLineID didn't exist and time was not on my side so I ended up deleting them all (>1100 of them) and resending them as InvoiceAdds.

Should I be returning TxnLineID at all times an that is my only choice, or can I query it AFTER I've posted my invoice? I am quite certain I should be bringing it in at all times, but what about all the historical invoices that don't have it?

Thanks,

John

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 470
Re: InvoiceMod - TxnLineID
« Reply #3 on: October 19, 2014, 10:44:00 AM »
I answered too quickly earlier on two fronts:

1) TxnLineID is included in transaction query Requests only when the user passes a value of "true" in the IncludeLineItems element.

2) I realized that I do capture TxnLineID whenever FMP records are being synched from data entered by QB users. It's vital when the client needs two-way synchronization or (most commonly) QB users are allowed to add/modify/delete transactions and transaction lines that will be pulled from QB and added as (or synched with existing) FMP records.

I strongly recommend to my clients that any Transaction that get pushed from FMP to QB will not modified in QB via the UI. This avoids the need reconcile synchronization conflicts and obviates the need to track TxnLineID values.

HTH!

Geoffrey Gerhard
Creative Solutions Incorporated
14000 Creekside Drive
Matthews, NC  28105
704) 814-6852
« Last Edit: October 20, 2014, 08:07:33 AM by Geoffrey Gerhard »

johnlewisdesign

  • Member
  • *
  • Posts: 81
Re: InvoiceMod - TxnLineID
« Reply #4 on: October 20, 2014, 04:42:22 AM »
Hi Geoffrey

VERY good to know - as this had been overlooked until this point. I will write this in to all future developments methinks :-)