Hello Dear everyone,
I wrote some code to get the differences between two ItemMasterdata, log instances to use this information to update the same ItemCode on a seconda Database.
Dim oCompany As SAPbobsCOM.Company = SBOAddonProject1.oCompany
Dim cl As SAPbobsCOM.ChangeLogsService
Dim GetChLgParam As GetChangeLogParams
Dim rs As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
Dim rs2 As SAPbobsCOM.Recordset = oCompany.GetBusinessObject(BoObjectTypes.BoRecordset)
Dim DifCLParams As SAPbobsCOM.ShowDifferenceParams
Dim RetParams As SAPbobsCOM.ChangeLogDifferencesParams
Dim ItemCode As String = "31002094"
Dim day As Date = Now.Date
Dim i As Integer
cl = oCompany.GetCompanyService.GetBusinessService(SAPbobsCOM.ServiceTypes.ChangeLogsService)
GetChLgParam = cl.GetDataInterface(ChangeLogsServiceDataInterfaces.clsGetChangeLogParams)
GetChLgParam.Object = BoChangeLogEnum.clItems 'BoChangeLogEnum.clCards
GetChLgParam.PrimaryKey = "31002094" '// Card Code
DifCLParams = cl.GetDataInterface(ChangeLogsServiceDataInterfaces.clsShowDifferenceParams)
DifCLParams.Object = BoChangeLogEnum.clItems
DifCLParams.PrimaryKey = ItemCode.ToString
DifCLParams.LogInstance = 19
DifCLParams.LogInstance2 = 24
RetParams = cl.GetChangeLogDifferences(DifCLParams)
For i = 0 To RetParams.Count - 1 Step 1
Dim array As Integer
Dim str As String
Dim Xml As String
str = "User Name: " & RetParams.Item(i).UserName & _
", Date:" & RetParams.Item(i).Date & _
", Field: " & RetParams.Item(i).ChangedField & _
", New: " & RetParams.Item(i).NewValue & _
", Old: " & RetParams.Item(i).OldValue & _
", Line: " & RetParams.Item(i).LineNumber & _
""
Application.SBO_Application.MessageBox(str, 1, "OK")
array = RetParams.Item(i).ArrayOffset
Xml = RetParams.ToXMLString
Xml = RetParams.GetXMLSchema(i)
RetParams.ToXMLFile("C:\gll.xml")
Xml = RetParams.Item(i).ArrayOffset
Next
I tried with no success to find any attribute, with the DB Name Field of the changed Field, does anyone know howto get the DB FieldName, so I can use that information to update the same changes on another DataBase?
Kind Regards,
Gabriela