on 04-04-2023 6:53 PM
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?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
12 | |
10 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.