18
Views
0
Comments
[XML Records] RecordToXml - Parent object empty if one of the fields is empty
Question
xml-records
Service icon
Forge asset by Afonso Carvalho

Hello

We have an issue RecordToXML Server Action


In the structure, the element is filled with two attributes Enddate and Attr_Leg..., End Date is empty but not the Attr_Leg 

After RecordToXML the parent object Leg... is not in the XML, even if all the attribute inside of it are not empty . (in this case there is a value to the Attr_Leg)

ExcludeIfnull is true


We expected:
After the categorization tag to have the Leg tag with Attr_leg in it: 
<Leg... Attr_Leg...="X"></Leg...>

But is is not generated in the XML


If you have several objects then it is working fine, everything is created in the XML:So the resulted XML looks like it : 
<Leg... Attr_Leg="W"><EndDate>2024-03-07</EndDate>/Leg...>
<Leg... Attr_ Leg...="X"></Leg...>


To sum up:
When an object contain only one child with one of the attribute empty (date in this case) the whole parent tag is not created in the XML. If we have several objects in the list everything is correctly generated in the Xml. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.