Code Samples

Enable the change log and list all changes, or only the change logs for a particular entity, Customer.

SUP101DB.EnableChangeLog();
SUP101DB.Synchronize();

// Retrieve all change logs
GenericList<IChangeLog> logs = SUP101DB.GetChangeLogs(new Query());
Console.WriteLine("There are " + logs.Count + " change logs");
foreach (IChangeLog log in logs)
{
Console.WriteLine(log.EntityType
+ "(" + log.SurrogateKey
+ "): " + log.OperationType);
}

// Retrieve only the change logs for Customer:
Query query = new Query();
AttributeTest at = new AttributeTest("entityType", 
SUP101.EntityType.Customer,
AttributeTest.EQUAL);
query.TestCriteria = at;
logs = SUP101DB.GetChangeLogs(query);
Console.WriteLine("There are " + logs.size() + " change logs for Customer");
foreach (IChangeLog log in logs)
{
Console.WriteLine(log.EntityType
+ "(" + log.SurrogateKey
+ "): " + log.OperationType);
}