cancel
Showing results for 
Search instead for 
Did you mean: 

SAPbobsCOM.GeneralData.ToXMLString is sometimes duplicating the UDFs from the header UDT

edward_tollenaar
Explorer
0 Kudos

In my Add-On, I'm adding a record in a UDT. Parts of the code:

companyService = Program.SBO_COMPANY.GetCompanyService();
gs = companyService.GetGeneralService("SWK_RSC");
generalData = (SAPbobsCOM.GeneralData)gs.GetDataInterface(GeneralServiceDataInterfaces.gsGeneralData);
generalData.SetProperty(<UDFField>, <value>); //Filling all UDFs on the header UDT.

generalData.Child("SWK_RSC_ROWS").Add();
generalData.Child("SWK_RSC_PACKAGES").Add();

var result = gs.Add(generalData);
rscDocEntry = (int)result.GetProperty("DocEntry");

//Get UDO data again, so have all keys etc.
generalParams = (SAPbobsCOM.GeneralDataParams)gs.GetDataInterface(SAPbobsCOM.GeneralServiceDataInterfaces.gsGeneralDataParams);
generalParams.SetProperty("DocEntry", rscDocEntry);
generalData = gs.GetByParams(generalParams);

string requestBody = generalData.ToXMLString();<br>

I have a few rare occasions where UDFs from the header UDT are duplicated, like:

	<SWK_RSC>
		<DocNum>6189</DocNum>
		<Period>98</Period>
		<Instance>0</Instance>
		<Series>-1</Series>
		<Handwrtten>N</Handwrtten>
		<Status>O</Status>
		<RequestStatus>W</RequestStatus>
		<Creator>edward</Creator>
		<Remark nil="true"/>
		<DocEntry>6189</DocEntry>
		<Canceled>N</Canceled>
		<Object>SWK_RSC</Object>
		<LogInst nil="true"/>
		<UserSign>271</UserSign>
		<Transfered>N</Transfered>
		<CreateDate>2023-04-03</CreateDate>
		<CreateTime>15:21:00</CreateTime>
		<UpdateDate>2023-04-03</UpdateDate>
		<UpdateTime>15:21:00</UpdateTime>
		<DataSource>O</DataSource>
		<U_SWK_BaseEntry nil="true"/>
		<U_SWK_BaseLine>1</U_SWK_BaseLine>
		<U_SWK_BaseType>23</U_SWK_BaseType>
		<U_SWK_DateReceived nil="true"/>
		<U_SWK_Description nil="true"/>
		<U_SWK_DestinationWhoto nil="true"/>
		<U_SWK_ErrorMsg nil="true"/>
		<U_SWK_HarmonCode nil="true"/>
		<U_SWK_HazardGoods>N</U_SWK_HazardGoods>
		<U_SWK_ItemCode>15-11</U_SWK_ItemCode>
		<U_SWK_MinQty>0.000000</U_SWK_MinQty>
		<U_SWK_Owner/>
		<U_SWK_RequestedQty>50.000000</U_SWK_RequestedQty>
		<U_SWK_RestrictCommod>N</U_SWK_RestrictCommod>
		<U_SWK_SourceKey1>106702</U_SWK_SourceKey1>
		<U_SWK_SourceWhoto nil="true"/>
		<U_SWK_Status>P</U_SWK_Status>
		<U_SWK_SwkTransKey nil="true"/>
		<U_SWK_TransStatus nil="true"/>
		<U_SWK_UpdateCount nil="true"/>
		<U_SWK_BaseEntry nil="true"/>
		<U_SWK_BaseLine>1</U_SWK_BaseLine>
		<U_SWK_BaseType>23</U_SWK_BaseType>
		<U_SWK_DateReceived nil="true"/>
		<U_SWK_Description nil="true"/>
		<U_SWK_DestinationWhoto nil="true"/>
		<U_SWK_ErrorMsg nil="true"/>
		<U_SWK_HarmonCode nil="true"/>
		<U_SWK_HazardGoods>N</U_SWK_HazardGoods>
		<U_SWK_ItemCode>15-11</U_SWK_ItemCode>
		<U_SWK_MinQty>0.000000</U_SWK_MinQty>
		<U_SWK_Owner/>
		<U_SWK_RequestedQty>50.000000</U_SWK_RequestedQty>
		<U_SWK_RestrictCommod>N</U_SWK_RestrictCommod>
		<U_SWK_SourceKey1>106702</U_SWK_SourceKey1>
		<U_SWK_SourceWhoto nil="true"/>
		<U_SWK_Status>P</U_SWK_Status>
		<U_SWK_SwkTransKey nil="true"/>
		<U_SWK_TransStatus nil="true"/>
		<U_SWK_UpdateCount nil="true"/>
		<SWK_RSC_PACKAGESCollection>
			<SWK_RSC_PACKAGES>
				<DocEntry>6189</DocEntry>
				<LineId>1</LineId>
				<VisOrder>0</VisOrder>
				<Object>SWK_RSC</Object>
				<LogInst nil="true"/>
				<U_SWK_PackageId nil="true"/>
				<U_SWK_PiecesPerPackage>0.000000</U_SWK_PiecesPerPackage>
				<U_SWK_Type nil="true"/>
				<U_SWK_WeightType nil="true"/>
				<U_SWK_Weight>0.000000</U_SWK_Weight>
				<U_SWK_PackageId nil="true"/>
				<U_SWK_PiecesPerPackage>0.000000</U_SWK_PiecesPerPackage>
				<U_SWK_Type nil="true"/>
				<U_SWK_WeightType nil="true"/>
				<U_SWK_Weight>0.000000</U_SWK_Weight>
			</SWK_RSC_PACKAGES>
		</SWK_RSC_PACKAGESCollection>
		<SWK_RSC_ROWSCollection>
			<SWK_RSC_ROWS>
				<DocEntry>6189</DocEntry>
				<LineId>1</LineId>
				<VisOrder>0</VisOrder>
				<Object>SWK_RSC</Object>
				<LogInst nil="true"/>
				<U_SWK_Quantity>0.000000</U_SWK_Quantity>
				<U_SWK_Regional nil="true"/>
				<U_SWK_Source nil="true"/>
				<U_SWK_Type nil="true"/>
				<U_SWK_Date nil="true"/>
				<U_SWK_Destination nil="true"/>
				<U_SWK_Quantity>0.000000</U_SWK_Quantity>
				<U_SWK_Regional nil="true"/>
				<U_SWK_Source nil="true"/>
				<U_SWK_Type nil="true"/>
				<U_SWK_Date nil="true"/>
				<U_SWK_Destination nil="true"/>
			</SWK_RSC_ROWS>
		</SWK_RSC_ROWSCollection>
	</SWK_RSC><br>

See UDFs U_SWK_BaseEntry till U_SWK_UpdateCount which are appearing twice.

This is not happening every time. Just some occasions. Any one seen this before?

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi edward67,

You appear to have the same scenario as mentioned in SAP Note 3258179.

Kindly check and verify the same.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

edward_tollenaar
Explorer
0 Kudos

Thanks, indeed looks like the same.

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi edward67,

If you would like to follow up, kindly create an incident for SAP Business One Support Team under the component SBO-SDK-DI .

Kindly mention the link of this thread/discussion while creating the incident.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support