SData Error when using PUT on SO_InvoiceHeader

I'm implementing an update operation for our integration and when I attempt a PUT operation I get the following error:

This entry already exists in batch SERVO.

Here's the raw request:

PUT ~/sdata/masapp/mascontract/abc/SO_InvoiceHeader('0100117') HTTP/1.1
Authorization: Basic ~
Content-Type: application/atom+xml;type=entry
Host: ~
Content-Length: 1008

<entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:xs="www.w3.org/.../XMLSchema" xmlns:cf="www.microsoft.com/.../2005" xmlns="http://www.w3.org/2005/Atom" xmlns:sdata="schemas.sage.com/.../1" xmlns:xsi="www.w3.org/.../XMLSchema-instance" xmlns:opensearch="a9.com/.../" xmlns:sync="schemas.sage.com/.../1" xmlns:sme="schemas.sage.com/.../2007" xmlns:http="schemas.sage.com/.../1">
<sdata:payload>
<SO_InvoiceHeader sdata:uri="10.190.198.243:8581/.../SO_InvoiceHeaderSPECIAL('0100117')" xmlns="">
<InvoiceNo>0100117</InvoiceNo>
<InvoiceDate>2015-07-02T21:39:58</InvoiceDate>
<ARDivisionNo>01</ARDivisionNo>
<CustomerNo>BRESLIN</CustomerNo>
<ShipDate>2015-07-02T21:39:58</ShipDate>
<BatchNo>TEMP</BatchNo>
<FreightAmt>0</FreightAmt>
<UDF_SERVICEPROORDERNO>11</UDF_SERVICEPROORDERNO>
</SO_InvoiceHeader>
</sdata:payload>
</entry>

I've tried this request in several different configurations, with/without a batchno specified, as a POST, using SO_InvoiceHeaderSPECIAL and using just SO_InvoiceHeader. The error message is always the same. In a previous version of our software our integration was able to change the batch of the invoice (but it didn't use SData). 

My question is: Is there anyway to change the batch or modify the Invoice header after a POST using SData?

Thanks,

Vinnie

  • 0
    As a follow up to this initial question about how to modify an existing invoice without getting the "already in a batch" error using SData I'd like to know if possible how to create a "Shipment" using SData. As far as I can tell, a Shipment is just an invoice in a "Shipping" batch. Is it possible to create an invoice in a shipping batch using SData? Do I need to create the batch first and if so, what entity do I call to create an empty batch that I can add shipments to? Can anyone clear up how SData interacts with shipments?

    Thanks,

    Vinnie
  • 0 in reply to MSI_Vinnie
    Are you trying to automate Shipment? Have you already successfully done it using just SData? Can you share please how you've done it? What are the tables to insert/update?