Error adding oAttachments2 to oPurchaseQuotations using B1 DI Server API

1 month ago 12

Hello All:

  I request to adhd oAttachment objects to oPurchaseQuotations. The carnal record was uploaded antecedently successful different process, ACT1 was not updated successful this process. 

 I  executed this oAttachment2 XML file:

<?xml version="1.0" encoding="UTF-16" ?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<SessionID>5GA1fP7hfApH8vTWL1ukllN/OJOZVoU/dXcUGMxRlL4D1QsUBTq/Q6wdBtqVPsrs</SessionID>
</env:Header>
<env:Body>
<AddObject xmlns="http://127.0.0.1/SAP/">
<BOM>
<BO>
<AdmInfo>
<Object>oAttachments2</Object>
</AdmInfo>
<Attachments2_Lines>
<row>
<SourcePath>\\myURL\aFolder</SourcePath>
<FileName>fileName</FileName>
<FileExtension>pdf</FileExtension>
</row>
<row>
<SourcePath>\\myURL\aFolder</SourcePath>
<FileName>anotherFileName</FileName>
<FileExtension>pdf</FileExtension>
</row>
</Attachments2_Lines>
</BO>
</BOM>
</AddObject>
</env:Body>
</env:Envelope>

The response from DI server is:

<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<env:Fault>
<env:Code>
<env:Value>env:Receiver</env:Value>
<env:Subcode>
<env:Value>-10</env:Value>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">A record with this sanction already exists. [ATC1.FileName][line: 1] , '\\myURL\aFolder\fileName.pdf'</env:Text>
</env:Reason>
<env:Detail>
<Object>221</Object>
<ObjectIndex>1</ObjectIndex>
<Command>AddObject</Command>
<SessionID>77AD6292-9C3B-41ED-B34F-3A1BC35AC07A</SessionID>
</env:Detail>
</env:Fault>
</env:Body>
</env:Envelope>

Then I renamed the files to debar the erstwhile mistake and the effect from DI Server is:

<?xml version="1.0"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
<env:Body>
<env:Fault>
<env:Code>
<env:Value>env:Receiver</env:Value>
<env:Subcode>
<env:Value>-5002</env:Value>
</env:Subcode>
</env:Code>
<env:Reason>
<env:Text xml:lang="en">Source record does not beryllium , ''\\myURL\aFolder\fileName.pdf'</env:Text>
</env:Reason>
<env:Detail>
<Object>221</Object>
<ObjectIndex>1</ObjectIndex>
<Command>AddObject</Command>
<SessionID>F1609CD3-F5A5-485A-B39C-5F98B4532F81</SessionID>
</env:Detail>
</env:Fault>
</env:Body>
</env:Envelope>

What's the process to bash this?

Best regards

Read Entire Article