cancel
Showing results for 
Search instead for 
Did you mean: 

How can I append a line to an existing set of attachments via B1iF?

claudiocalabresi
Explorer
0 Kudos

Dear Experts,

I need to append a line to an existing set of attachments via B1iF. I do not want to update any field of the existing lines.

Example:

The attachments table ATC1 contains two lines (Line 1 and Line 2) having the same AbsEntry 1025.

I need to append a third line to this existing set of lines. I do not want to update any field of the two existing lines.

I cannot use the schema below, as it automatically overwrites the Date (attachment date) field.

<xsl:template name="transform">

<Attachments2>

<row>

<AbsoluteEntry>1025</AbsoluteEntry>

</row>

</Attachments2>

<Attachments2_Lines>

<row>

<SourcePath>[MyPath]</SourcePath>

<FileName>File1</FileName>

<FileExtension>pdf</FileExtension>

<Override>tYES</Override>

</row>

<row>

<SourcePath>[MyPath]</SourcePath>

<FileName>File2</FileName>

<FileExtension>pdf</FileExtension>

<Override>tYES</Override>

</row>

<row>

<SourcePath>[MyPath]</SourcePath>

<FileName>File3</FileName>

<FileExtension>pdf</FileExtension>

<Override>tYES</Override>

</row>

</Attachments2_Lines>

</xsl:template>

Note: Using DTW template I can easily solve this issue using LineNum = 2.

How can I get the same result using Integration Framework?

Thank you, Claudio

Nicolas_Fuchs
Advisor
Advisor
0 Kudos

Hi Claudio,
if you want to update existing attachment lines you first need to read all existing attachment lines assigned to the "AbsoluteEntry". Afterwards you built a new message containing the previous attachment lines as well as the new one(s). Of course you have to use update to send it back to B1. Here's an example on how the message looks like in Integration Framework Version 2 - the last row of the attachment lines has been added in addition to the existing ones.

<Envelope2 throwException="false" autoCommit="true">
<DiCall>
<Header>
<Action>update</Action>
<WritePolicy insert_on_exists="fallback2U"
update_policy="regular"
update_on_miss="fallback2I"/>
</Header>
<Body>
<BOM>
<BO>
<AdmInfo>
<Object>221</Object>
<Version>2</Version>
</AdmInfo>
<QueryParams>
<AbsoluteEntry>5</AbsoluteEntry>
</QueryParams>
<Attachments2_Lines>
<row>
<SourcePath>C:\TEMP</SourcePath>
<FileName>sdb</FileName>
<FileExtension>xml</FileExtension>
<Override>Y</Override>
<FreeText/>
<CopyToTargetDoc>Y</CopyToTargetDoc>
</row>
<row>
<SourcePath>C:\TEMP</SourcePath>
<FileName>tesfile</FileName>
<FileExtension>csv</FileExtension>
<Override>Y</Override>
<FreeText/>
<CopyToTargetDoc>Y</CopyToTargetDoc>
</row>
<row>
<SourcePath>C:\TEMP</SourcePath>
<FileName>bild1</FileName>
<FileExtension>jpg</FileExtension>
<Override>Y</Override>
<FreeText/>
<CopyToTargetDoc>Y</CopyToTargetDoc>
</row>
</Attachments2_Lines>
</BO>
</BOM>
</Body>
</DiCall>
</Envelope2>

Hope this helps!

Regards, Nicolas

Accepted Solutions (0)

Answers (0)