I am using SData for Sage 100 to create invoices for AP. I am able to create an AP_InvoiceHeader and a single AP_InvoiceDetail line item using the AP_InvoiceHeaderSPECIAL template including the standard AP_InvoiceDetail. That works just fine.
The issue I am having is creating additional line items on the AP Invoice. According to the Sage 100 ERP Guide to Sdata:
When I try to do this using AP_InvoiceDetail I get an error: This entry already exists in batch 04990. For reference, batch 04990 is the batch that contains my invoice I created using the AP_InvoiceHeaderSpecial.
Here is what my payload looks like. For reference, my original Invoice is 399980, Division is 01, VendorNo is AIRWAY:
{<payload xmlns="schemas.sage.com/.../1">
<AP_InvoiceDetail p2:uri="developmentUrl/.../$template" xmlns:p2="schemas.sage.com/.../1" xmlns="">
<APDivisionNo>01</APDivisionNo>
<VendorNo>AIRWAY</VendorNo>
<InvoiceNo>399980</InvoiceNo>
<LineKey />
<LineSeqNo />
<AccountKey>100000000</AccountKey>
<JobNo />
<CostCode />
<CostType />
<UnitOfMeasure />
<CommentText />
<TransferAPDivisionNo />
<TransferVendorNo />
<TransferInvoiceNo />
<TransferForm1099 />
<TransferBox1099 />
<AssetTemplate />
<QuantityDistributed>0.0000</QuantityDistributed>
<DistributionAmt>3.00</DistributionAmt>
<RetentionRate>0.0000</RetentionRate>
<UnitCost>0.0000</UnitCost>
<RetentionAmt>0.0000</RetentionAmt>
<TransferDiscount>0.0000</TransferDiscount>
<DistributionPercentage>0.0000</DistributionPercentage>
</AP_InvoiceDetail>
</payload>}