we have developed an addon on B1 9.3 PL8 and encountered the following problem.
We have created many user fields in the OBTN table that we are going to fill through SDK.
The initial structure of user fields in OBTN field was the following:
... U_DIFETTO3;NVARCHAR;50;STRING;;;; U_POSDIF3;NVARCHAR;10;STRING;;;; U_FUORISTANDARD;NVARCHAR;1;STRING;;;; U_PESO;DECIMAL;21,6;FIXED;;;; U_NUMFOGLI;DECIMAL;21,6;FIXED;;;; U_CONFEZIONE;NVARCHAR;10;STRING;;;; U_DISPO;NVARCHAR;50;STRING;;;; U_MACHINE;NVARCHAR;30;STRING;;;; U_OPERATORE;NVARCHAR;30;STRING;;;; U_FLGOLDBC;NVARCHAR;1;STRING;;;N; U_LOTTONUOVO;NVARCHAR;50;STRING;;;;
After deleting the user field (U_POSDIF3) from OBTN table via SAP Business One, we found an incorrect assignment of the values of the successive fields valued through SDK.
The problem encountered after deletion is that the values written in the U_PESO field using the following code:
oCompany = (SAPbobsCOM.Company)Application.SBO_Application.Company.GetDICompany(); ... SAPbobsCOM.Documents oDocDraftEntratam = (SAPbobsCOM.Documents)Program.oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInventoryGenEntry); ... oDocDraftEntratam.Lines.BatchNumbers.UserFields.Fields.Item("U_PESO").Value = peso;
are assigned to U_NUMFOGLI field. Same problem for the following fields.
Before the field was deleted, code worked properly for several months
We have tried to restart the SLD services and the HANA db.and we also opened a ticket to SAP which replied :"scenario has been investigated (and replicated using your code sample), however the circumstances you have described relate to a consulting question rather than giving evidence of a possible error and / or bug with standard delivered SAP products and / or documentation." and they suggested we ask on the forum.
Can anyone help us understand what mistake we are making in the code?
Thanks in advance.