How to: Clean synchronization log

First, an image to help illustrate my post:
Capturar
Yes I know, it`s in Portuguese. Sorry about that but it`s not something that I can reproduce whenever I want.
So, as you can see there is 45 errors and 101 warning, that`s a lot of errors right? Wrong, because the synchronization form will show all registry on SqlSyncInfo Table, which means if an error/warning is not fixed, every time you have to synchronize it will increase the errors/warnings count and will shows errors that no longer exist.
For example, on the image above you can see it and think that the database has so many errors and warnings that the database is practically lost, but the truth is, there is only one warning which disappeared after the synchronization.
I really would like to see a synchronization log which only shows the current errors and warnings, maybe in RC3, but for now after a bit of work I made a Job that backup the SqlSyncInfo if the user wishes and then delete all registry from SqlSyncInfo.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/// <summary>
/// This job will save the synchronization log on C:\
/// and then will delete all data on SqlSyncInfo table
/// </summary>
/// <remarks>
/// Author: Christian Fleishmann Silva
/// </remarks>
 
static void Delete_SynchronizationLog(Args _args)
{
    TextIO          file;
    container       line;
    SqlSyncInfo     syncLog;
 
    Dialog          dialog  = new dialog("Synchronization Log Backup" );
    ;
 
    #define.filename( 'C:\\AX_SyncronizationLog.csv')
    #File
 
    file = new TextIo(#filename,#io_write);
    file.outFieldDelimiter( ';');
 
    dialog.addText( 'Do you wish to backup the synchronization log?' );
 
    if (dialog.run())
    {
        if (!file || file.status() != IO_Status::Ok)
            throw error ("File cannot be opened" );
 
        while select syncLog
        {
            line = [syncLog.TableName, syncLog.ParentID, syncLog.Text];
            file.writeExp(line);
        }
    }
 
    delete_from syncLog;
    Box::info( 'Synchronization log successfully deleted' );
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.