4

When I try to associate a Payment with an Invoice, I get the following error:

ReceivePaymentAdd
ORApplyPayment:
OR object has multiple values
End of ORApplyPayment
End of ReceivePaymentAdd

What does that error mean? How do I get this to work?

Note that I am pushing the Invoice into QuickBooks in a separate session, so I cannot use Macros. If I use IsAutoApply true without the AppliedToTxnAdd block, the payment pushes just fine.

Here is the generated xml:

<?xml version="1.0" encoding="utf-8"?>
<?qbxml version="10.0"?>
<QBXML>
<QBXMLMsgsRq onError = "continueOnError">
<ReceivePaymentAddRq requestID = "0">
<ReceivePaymentAdd>
<CustomerRef>
<ListID>8000003F-1415364262</ListID>
</CustomerRef>
<ARAccountRef>
<FullName>Accounts Receivable</FullName>
</ARAccountRef>
<TxnDate>2014-02-14</TxnDate>
<RefNumber>1003 - P1</RefNumber>
<TotalAmount>850.00</TotalAmount>
<PaymentMethodRef>
<FullName>20 - Check</FullName>
</PaymentMethodRef>
<Memo/>
<IsAutoApply>0</IsAutoApply>
<AppliedToTxnAdd>
<TxnID>C7-1415364350</TxnID>
<PaymentAmount>850.00</PaymentAmount>
</AppliedToTxnAdd>
</ReceivePaymentAdd>
</ReceivePaymentAddRq>
</QBXMLMsgsRq>
</QBXML>

1 Answers1

4

This:

ORApplyPayment: OR object has multiple values End of ORApplyPayment

Means that the specification (see the QuickBooks OSR) specifies that you can use EITHER AppliedToTxnAdd OR you can use IsAutoApply, but you may not use both of them. You can use one, OR the other.

You're using both, so you're getting an error message. Either remove <IsAutoApply> or remove your <AppliedToTxnAdd> tag.

Here's an example for you:

Keith Palmer Jr.
  • 27,666
  • 16
  • 68
  • 105
  • Thanks so much! That error message is quite unclear, and I see nothing in the OSR about IsAutoApply being exclusive of AppliedToTxnId. It is all working now. – MicrosoftAccessPros.com Nov 11 '14 at 09:32
  • while I'm sure this answer is correct, I'm not so sure that's what the OR stands for. If I am correct, that wording in the answer can be misleading. I am basing my suspicion on this link: [developer-static.intuit](https://developer-static.intuit.com/qbsdk-current/samples/readme.html#billadd (C++) (qbfc) (desktop)) – Heriberto Lugo Feb 26 '18 at 20:32
  • the previous link states: Setting an OR object (object of mutually exclusive elements) - Setting a Ref object (reference to another list object) – Heriberto Lugo Feb 26 '18 at 20:33
  • stackoverflow broke my link.. heres the correct link shortened: goo.gl/i7hnWb – Heriberto Lugo Feb 26 '18 at 20:41
  • I'm also trying to add ReceivePayment for a Invoice. It will be really helpfull if someone answer for my doubt here. Which 'C7-1415364350 ' number is added here in. Is it that particular invoice 'TxnID' that we are going to generate for ReceivePayment?. Also how to add check number in payment type? – SreRoR May 26 '22 at 13:48
  • The `TxnID` is the `TxnID` of the _invoice_ you are applying a payment against. – Keith Palmer Jr. May 28 '22 at 00:07