I have what I thought was the simplest of payable with distributions but I'm getting the below error. There is a fix for the same error here but it doesn't apply to me.
Microsoft.Dynamics.GP.eConnect.eConnectException: 'Sql procedure error codes returned:
Error Number = 349 Stored Procedure= taPMTransactionInsert Error Description = Unable to update/create distributions
Error Number = 700 Stored Procedure= taPMDistributionCreate Error Description = At least one input variable contains a null value in the taPMDistributionCreate
Node Identifier Parameters: taPMDistributionCreate
DOCTYPE = 1
VCHNUMWK = 00000000227458635
VENDORID = TheVendorId
<taPMTransactionInsert>
<BACHNUMB>10027</BACHNUMB>
<VCHNUMWK>00000000227458635</VCHNUMWK>
<VENDORID>TheVendorId</VENDORID>
<DOCNUMBR>10027</DOCNUMBR>
<DOCTYPE>1</DOCTYPE>
<DOCAMNT>151.430000</DOCAMNT>
<DOCDATE>2023-07-15</DOCDATE>
<PRCHAMNT>151.430000</PRCHAMNT>
<CHRGAMNT>151.430000</CHRGAMNT>
<CREATEDIST>0</CREATEDIST>
</taPMTransactionInsert>
'
The full XML is as follows:
<PMTransactionType>
<eConnectProcessInfo xsi:nil="true" />
<taRequesterTrxDisabler_Items xsi:nil="true" />
<taUpdateCreateVendorRcd xsi:nil="true" />
<taCreateVendorAddress_Items xsi:nil="true" />
<taPMTransactionTaxInsert_Items xsi:nil="true" />
<taPMDistribution_Items>
<taPMDistribution>
<DOCTYPE>1</DOCTYPE>
<VCHRNMBR>00000000227458635</VCHRNMBR>
<VENDORID>TheVendorId</VENDORID>
<DISTTYPE>6</DISTTYPE>
<ACTNUMST>40-033-51000</ACTNUMST>
<DEBITAMT>151.430000</DEBITAMT>
</taPMDistribution>
<taPMDistribution>
<DOCTYPE>1</DOCTYPE>
<VCHRNMBR>00000000227458635</VCHRNMBR>
<VENDORID>TheVendorId</VENDORID>
<DISTTYPE>2</DISTTYPE>
<ACTNUMST>00-000-20000</ACTNUMST>
<CRDTAMNT>151.430000</CRDTAMNT>
</taPMDistribution>
</taPMDistribution_Items>
<taAnalyticsDistribution_Items xsi:nil="true" />
<taPMTransactionInsert>
<BACHNUMB>10027</BACHNUMB>
<VCHNUMWK>00000000227458635</VCHNUMWK>
<VENDORID>TheVendorId</VENDORID>
<DOCNUMBR>10027</DOCNUMBR>
<DOCTYPE>1</DOCTYPE>
<DOCAMNT>151.430000</DOCAMNT>
<DOCDATE>2023-07-15</DOCDATE>
<PRCHAMNT>151.430000</PRCHAMNT>
<CHRGAMNT>151.430000</CHRGAMNT>
<CREATEDIST>0</CREATEDIST>
</taPMTransactionInsert>
<taMdaUpdate_Items xsi:nil="true" />
</PMTransactionType>
</eConnect>
Is there something obvious I am missing? I assume that the problem is some value on one of the distributions but in all the documentation I can find this meets the required elements. Maybe I shouldn't be specifying the batch number? I'm also using our own document number, should I do a look up like I'm doing for the voucher number (taGetPMNextVoucherNumber)? The rest seems straight-forward.
Thanks,
Brian