:question: Create Vendor Payment via SOAP - Any ki...
# suitetalkapi
g
Create Vendor Payment via SOAP - Any kind soul's out there willing to help a relatively new NetSuite developer out with a partially failing request? Attempting to create Vendor Payments via SOAP WebServices: Request:
Copy code
<record externalId="461b1773-8a89-4bfa-9b55-0ac8ac8f74c9" xsi:type="tranPurch:VendorPayment" xmlns:tranPurch="urn:purchases_2020_2.transactions.webservices.netsuite.com">
                <tranPurch:account internalId="217" xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com"/>
                <tranPurch:entity internalId="108533" xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com"/>
                <tranPurch:tranDate>2021-12-27T05:26:55.000-08:00</tranPurch:tranDate>
                <tranPurch:memo>West Palm Beach to Fort Pierce on Dec 21, 2021</tranPurch:memo>
                <tranPurch:applyList replaceAll="true">
                    <tranPurch:apply>
                        <tranPurch:apply>true</tranPurch:apply>
                        <tranPurch:doc>1896390</tranPurch:doc>
                        <tranPurch:applyDate>2021-12-27T05:26:55.000-08:00</tranPurch:applyDate>
                        <tranPurch:amount>54.74</tranPurch:amount>
                    </tranPurch:apply>
                </tranPurch:applyList>
            </record>
Response:
Copy code
<writeResponse>
                    <platformCore:status isSuccess="false" xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com">
                        <platformCore:statusDetail type="ERROR">
                            <platformCore:code>USER_ERROR</platformCore:code>
                            <platformCore:message>Unable to find a matching line for sublist apply with key: [doc,line] and value: [1896390,null].</platformCore:message>
                        </platformCore:statusDetail>
                    </platformCore:status>
                    <baseRef xsi:type="platformCore:RecordRef" type="vendorPayment" externalId="461b1773-8a89-4bfa-9b55-0ac8ac8f74c9" xmlns:platformCore="urn:core_2020_2.platform.webservices.netsuite.com"/>
                </writeResponse>
Other information: 1. The vendor bill is created in NetSuite ready for payment to be applied 2. This request only fails about 25% of the time, the other 75% with identical payloads succeed 🤷‍♂️
s
first, notice in the error it shows value [ x, null ] - so my guess is some of the time you're sending a
doc
value which does not match the value on any available lines on the
apply
sublist. One way to test this is to try creating a vendor payment in the NS UI and inspect for yourself that the line you're indicating in a failing payload does/doesn't exist on the apply tab in NS.
g
First of all @Shawn Talbert thank you so much for reading my question and responding, I really appreciate it. I thought the same thing at first, and after checking many records with these errors I came the conclusion that it doesn't appear to be an amount mismatch. In this particular example, as you can see the apply amount to doc
1896390
is
54.74
. When going to that particular doc in NetSuite UI, you will see there is an item for
54.74
. This is consistent amongst all the errors I receive. Remember that about 75% of these actually succeed which is most peculiar.
s
I think it's not the amount but rather the
doc
field you need to ensure matches.
g
I don't think I'm following, the
doc
number (in this case Vendor Bill) matches properly for each error response.
Vendor Payment of $54.74 should be applied to doc (Vendor Bill)
1896390
- This is accurate and showing the proper bill in NetSuite UI with the proper item amount to be paid against.
b
what does the initialize operation for the vendor payment look like
g
I'm not familiar with any initialize operation and I don't see any in the webservices process log
b
use the initialize operation so that you can see which lines are available and what their keys are
g
After speaking with NetSuite Support it appears the issue is related to the replaceAll option. I'm going to try that out now and I will report back 🤷‍♂️