.
Hello,
I would like to export a BOD of type Sync.SalesOrder in a file.
To do this, I followed all the advice and recommendations I read in this forum.
I more or less managed to put all the elements in place and finally managed to produce an on-Premise CSV file.
But, so mechanically, I have some initial successes.
Nevertheless, the content of this file does not match my expectations.
By analyzing my problem step by step, I think that the first cause comes from the mapping phase.
Indeed, I created a custom BOD to simplify the standard BOD and to retain only the few desired fields for my CSV export.
Then I created a mapping between the standard BOD and the Custom BOD.
And when I test it, I see that, for example, if I have a sales order with 4 rows as input, I come out after the mapping with a BOD with only one row accumulating the field values of these 4 rows.

Here are a few screenshots to make it clearer. Where did I go wrong to produce this result? Because even if I created a file template to be able to write in a CSV file, this step only transports the error generated upstream.

<?xml version="1.0" encoding="UTF-8"?>
<!--
Mapping: DMSalesOrder4
Description:
Version: 1
Created by:
Created on:
Last updated by:
Last updated on:
Input: Sync.SalesOrder
Output: Sync.DMSalesOrder4
Product Version: Infor ION 2021-05
XSLT Code Generator: V2
Copyright © 2021 Infor. All rights reserved.
The word and design marks set forth herein are trademarks and/or registered trademarks of Infor and/or its affiliates and subsidiaries.
All rights reserved. All other trademarks listed herein are the property of their respective owners.
www.infor.com
-->
<xsl:stylesheet version="2.0" xmlns="">schema.infor.com/.../2" xmlns:expath-zip="">http://expath.org/ns/zip" xmlns:fn="">www.w3.org/.../xpath-functions" xmlns:dns="">schema.infor.com/.../2" xmlns:saxon="">http://saxon.sf.net/" xmlns:udf1="">http://infor.com/custom" xmlns:expath-file="">http://expath.org/ns/file" xmlns:xsi="">www.w3.org/.../XMLSchema-instance" xmlns:xsl="">www.w3.org/.../Transform" xmlns:exslt-random="">http://exslt.org/random" xmlns:exslt-common="">http://exslt.org/common" xmlns:exslt-math="">http://exslt.org/math" xmlns:xs="">www.w3.org/.../XMLSchema" xmlns:math="">www.w3.org/.../math" xmlns:map="">www.w3.org/.../map" exclude-result-prefixes="xs xsl fn expath-file expath-zip exslt-common exslt-math exslt-random map math saxon xsi ">
<xsl:output method="xml" encoding="UTF-8" indent="no" byte-order-mark="no"/>
<xsl:strip-space elements="*"/>
<xsl:function name="udf1:get-first-value">
<xsl:param name="input-list"/>
<xsl:value-of select="$input-list[1]"/>
</xsl:function>
<xsl:template match="/">
<xsl:element name="SyncDMSalesOrder4">
<xsl:namespace name="xs" select="'">www.w3.org/.../>
<xsl:if test="/*:SyncSalesOrder/@languageCode">
<xsl:attribute name="languageCode">
<xsl:value-of select="/*:SyncSalesOrder/@languageCode"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="/*:SyncSalesOrder/@releaseID">
<xsl:attribute name="releaseID">
<xsl:value-of select="/*:SyncSalesOrder/@releaseID"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="/*:SyncSalesOrder/@systemEnvironmentCode">
<xsl:attribute name="systemEnvironmentCode">
<xsl:value-of select="/*:SyncSalesOrder/@systemEnvironmentCode"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="/*:SyncSalesOrder/@versionID">
<xsl:attribute name="versionID">
<xsl:value-of select="/*:SyncSalesOrder/@versionID"/>
</xsl:attribute>
</xsl:if>
<xsl:copy-of select="/*:SyncSalesOrder/*:ApplicationArea" copy-namespaces="no" />
<xsl:element name="DataArea">
<xsl:copy-of select="/*:SyncSalesOrder/*:DataArea/*:Sync" copy-namespaces="no" />
<xsl:element name="DMSalesOrder4">
<xsl:element name="SampleHeader">
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:DocumentID/*:ID">
<xsl:element name="DocumentID">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:DocumentID/*:ID/text()"/>
</xsl:element>
</xsl:if>
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:DocumentDateTime">
<xsl:element name="DocumentDateTime">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:DocumentDateTime/text()"/>
</xsl:element>
</xsl:if>
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:Status/*:ReasonCode">
<xsl:element name="Status">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:Status/*:ReasonCode/text()"/>
</xsl:element>
</xsl:if>
<xsl:element name="CustomerPartyName">
<xsl:variable name="data000">
<xsl:value-of select="udf1:get-first-value(/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:CustomerParty/*:Name)"/>
</xsl:variable>
<xsl:value-of select="fn:string($data000)"/>
</xsl:element>
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:CustomerParty/*:Location/*:Address/*:CityName">
<xsl:element name="CustomerPartyCityName">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderHeader/*:CustomerParty/*:Location/*:Address/*:CityName/text()"/>
</xsl:element>
</xsl:if>
</xsl:element>
<xsl:element name="SampleLine">
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:LineNumber">
<xsl:element name="LineNumber">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:LineNumber/text()"/>
</xsl:element>
</xsl:if>
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:Item/*:ItemID/*:ID">
<xsl:element name="ItemID">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:Item/*:ItemID/*:ID/text()"/>
</xsl:element>
</xsl:if>
<xsl:element name="ItemDescription">
<xsl:variable name="data000">
<xsl:value-of select="udf1:get-first-value(/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:Description)"/>
</xsl:variable>
<xsl:value-of select="fn:string($data000)"/>
</xsl:element>
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:Quantity">
<xsl:element name="BasisQuantity">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:Quantity/text()"/>
</xsl:element>
</xsl:if>
<xsl:if test="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:Quantity/@unitCode">
<xsl:element name="UnitCode">
<xsl:value-of select="/*:SyncSalesOrder/*:DataArea/*:SalesOrder/*:SalesOrderLine/*:Quantity/@unitCode"/>
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
Thanks for your advice