Author Topic: CODE: 3120  (Read 1356 times)

mstanford

  • Member
  • *
  • Posts: 3
CODE: 3120
« on: November 12, 2014, 11:50:50 AM »
Hi all,

Hoping someone will have some insight as to why my payment push script suddenly stopped working over night.

Since August we have been pushing Customers, Invoices, Credit Memos, and Payments to QB from FileMaker on a nightly basis. This morning I took a look at the error log and noticed that all of the payments had a 3120 error (Object "Txn ID Here" specified in the request cannot be found).

I understand this could happen if an Invoice was removed or manually remade in QB. But, I can confirm that the TxnID does indeed exist using a query based on the stored RefNumber (which is my unique invoice ID in FileMaker). I get back the exact same TxnID that is listed in the error.

What I don't understand is why this would break after no changes to the script in 3 months.

I read on a post in the forum here from 2009 where someone suggested that an Accounts Receivable assignment is needed.
PCQB_RqAddFieldWithValue( "ARAccountRef::FullName" ;"ACCOUNTS RECIEVABLE")

However, we have successfully been pushing payments for months now without specifying that value.

Any thoughts?

FM 13 Advanced
QB Enterprise 14
FMBooks Connector 6.0.2.3

#Add payment
Set Variable [ $$Result; Value:PCQB_RqNew("ReceivePaymentAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "CustomerRef::ListID" ; If ( $$company = "Publishing" ; invCustomers::qbListIDPub ; invCustomers::qbListIDProd ) ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnDate"; invPayments::date ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "RefNumber" ; invPayments::idPkPayment ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TotalAmount"; invPayments::amount ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PaymentMethodRef::FullName"; If ( invPayments::method = "Credit Card" ; invPaymentsCreditCardsSelected::type ; invPayments::method ) ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Memo"; invPayments::note ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "DepositToAccountRef::FullName" ; invPaymentsAccounts::qbNameFull ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AppliedToTxnAdd::TxnID" ; inv::qbTxnIDInvoice ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "AppliedToTxnAdd::PaymentAmount" ; invPayments::amount ) ]
#Execute
Set Variable [ $$Result; Value:PCQB_RqExecute ]

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: CODE: 3120
« Reply #1 on: November 12, 2014, 12:42:22 PM »
I'm not sure why it worked before and now does not, but I suggest you follow the step...

Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "DepositToAccountRef::FullName" ; invPaymentsAccounts::qbNameFull ) ]

...with a new step...

Set Variable [ $$Result; PCQB_RqAddRelatedRecord ( "AppliedToTxnAdd" ; "" ; "" ) ]

...and remove the string "AppliedToTxnAdd::" from the Type parameter in the steps that identify TxnID and PaymentAmount. That may solve the problem, and will definitely allow more flexibility if you need to amend the script for multiple distributions of a single payment.

HTH!

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

mstanford

  • Member
  • *
  • Posts: 3
Re: CODE: 3120
« Reply #2 on: November 12, 2014, 12:59:07 PM »
Hi Geoffrey,

I have made the changes you suggested. The balance for the invoice is now set to $0, showing that the few steps you had me add are working as intended. However, the payment itself isn't showing up under the customer transactions in QB. Just the original invoice.

The new code looks like this:

#Add payment
Set Variable [ $$Result; Value:PCQB_RqNew("ReceivePaymentAdd" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "CustomerRef::ListID" ; If ( $$company = "Publishing" ; invCustomers::qbListIDPub ; invCustomers::qbListIDProd ) ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnDate"; invPayments::date ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "RefNumber" ; invPayments::idPkPayment ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TotalAmount"; invPayments::amount ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PaymentMethodRef::FullName"; If ( invPayments::method = "Credit Card" ; invPaymentsCreditCardsSelected::type ; invPayments::method ) ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "Memo"; invPayments::note ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "DepositToAccountRef::FullName" ; invPaymentsAccounts::qbNameFull ) ]
Set Variable [ $$Result; PCQB_RqAddRelatedRecord ( "AppliedToTxnAdd" ; "" ; "" ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "TxnID" ; inv::qbTxnIDInvoice ) ]
Set Variable [ $$Result; Value:PCQB_RqAddFieldWithValue( "PaymentAmount" ; invPayments::amount ) ]
#Execute
Set Variable [ $$Result; Value:PCQB_RqExecute ]

Geoffrey Gerhard

  • Guru
  • Member
  • ****
  • Posts: 468
Re: CODE: 3120
« Reply #3 on: November 13, 2014, 12:11:57 PM »
That you're conditionally setting the value of CustomerRef::ListID makes me wonder if the payment is tied to a different Customer. I'd double check that the value you set there matches the value in the CustomerRef::ListID element of the Invoice.

HTH!

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

mstanford

  • Member
  • *
  • Posts: 3
Re: CODE: 3120
« Reply #4 on: November 13, 2014, 02:33:04 PM »
Just spent the day on the phone with the client and Intuit. Turns out their QB files were very corrupt. Failed verification, failed rebuild attempt. The files have to taken offline, sent out, and fixed manually by a QB dev team.

I'll post more when we get them back and see if the original script starts working again.