biuan SAP® BUSINESS ONE SDK
API Change Logs Service

Description

You can use the change log to gain an overview of changes in most windows of SAP Business One. Each time you update, for example, tax groups, withholding tax, house banks, freight, credit card, authorizations, sales, purchasing documents, production orders, charts of accounts, or UDOs, you can use the ChangeLogsService service to look up the change logs and show the differences between two change logs.

Source table: OGCL.

Object Model

Remarks

To access the change log in the SAP Business One application, open a window and make changes, if necessary; then (with the window still open) choose Tools --> Change Log....

To display the differences between two change log instances, select the instances and choose the Show Differences button.

Example

Getting Change Log and Showing Differences between 2 Change Log Instances (C#)
// This sample shows how to use the change log service // We will get the change log of business partner with BP Code "BPID01" // We will show the differences between 2 ChangeLog instances ChangeLogsService cl = (ChangeLogsService)vCompSvr.GetBusinessService(SAPbobsCOM.ServiceTypes.ChangeLogsService); GetChangeLogParams GetChLgParam = (GetChangeLogParams)cl.GetDataInterface(ChangeLogsServiceDataInterfaces.clsGetChangeLogParams); ChangeLogsParams ChLgParams; GetChLgParam.Object = BoChangeLogEnum.clCards; //BusinessPartners GetChLgParam.PrimaryKey = "BPID01"; // Card Code // Get Change Log ChLgParams = cl.GetChangeLog(GetChLgParam); // Show the first 2 changes // Change Instance 1 MessageBox.Show("Instance 1: " + ChLgParams.Item(0).LogInstance + ", Object Code: " + ChLgParams.Item(0).ObjectCode + ", Update Date: " + ChLgParams.Item(0).UpdatedDate + ", User Name: " + ChLgParams.Item(0).UserName); // Change Instance 2 MessageBox.Show("Instance 2: " + ChLgParams.Item(1).LogInstance + ", Object Code: " + ChLgParams.Item(1).ObjectCode + ", Update Date: " + ChLgParams.Item(1).UpdatedDate + ", User Name: " + ChLgParams.Item(1).UserName); // Show the differences between the instances ShowDifferenceParams param = (ShowDifferenceParams)cl.GetDataInterface(ChangeLogsServiceDataInterfaces.clsShowDifferenceParams); param.Object = BoChangeLogEnum.clCards; // BusinessPartners param.PrimaryKey = "BPID01"; // Card Code // We will get the differences of these 2 instances param.LogInstance = 1; param.LogInstance2 = 2; ChangeLogDifferencesParams retparams = null; // Get differences retparams = cl.GetChangeLogDifferences(param); // Show the differences for (int i = 0; i < retparams.Count; i++) { MessageBox.Show("User Name: " + retparams.Item(i).UserName + ", Date: " + retparams.Item(i).Date + ", Changed Field: " + retparams.Item(i).ChangedField + ", New Value: " + retparams.Item(i).NewValue + ", Old Value: " + retparams.Item(i).OldValue + ", Line Number: " + retparams.Item(i).LineNumber + ", Array Offset: " + retparams.Item(i).ArrayOffset); }

See Also

SAP® B1 DI-API C# definition

public class ChangeLogsServiceClass : IChangeLogsService, ChangeLogsService { public extern ChangeLogsServiceClass(); public virtual extern ChangeLogsParams GetChangeLog( GetChangeLogParams pIGetChangeLogParams); public virtual extern ChangeLogDifferencesParams GetChangeLogDifferences( ShowDifferenceParams pIShowDifferenceParams); public virtual extern object GetDataInterface( ChangeLogsServiceDataInterfaces enumMSDI); public virtual extern object GetDataInterfaceFromXMLFile( string bstrFileName); public virtual extern object GetDataInterfaceFromXMLString( string bstrXMLString); }

Related information


Get Change Log Params GetChangeLogParams Object
Holds the key to an existing change log.  This object is used to pass keys to and retrieve keys from the ChangeLogsService methods.
   Parent: Change Logs Service ChangeLogsService Service· Table: OGCL

Show Difference Params ShowDifferenceParams Object
Holds the key to an existing change log that contains several log instances.  This object is used to pass keys to and retrieve keys from the ChangeLogsService methods.
   Parent: Change Logs Service ChangeLogsService Service· Table: OGCL

Change Logs Service Data Interfaces ChangeLogsServiceDataInterfaces Enumeration
ChangeLogsService data interfaces.
   Parent: Change Logs Service ChangeLogsService Service· Table: OGCL

Change Log Differences Params ChangeLogDifferencesParams Collection
A collection of ChangeLogDifferencesParam objects.
   Parent: Change Logs Service ChangeLogsService Service· Table: OGCL

Change Logs Params ChangeLogsParams Collection
A collection of ChangeLogParams objects.
   Parent: Change Logs Service ChangeLogsService Service· Table: OGCL


SAP® Business One is the trademark(s) or registered trademark(s) of SAP AG in Germany and in several other countries. Icons by Icons8 Contact
This website is not affiliated with, maintained, authorized, endorsed or sponsored by SAP AG or any of its affiliates