Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Contents

Table of Contents
minLevel1
maxLevel3
excludeContents

...

The third field _ will show you the _ sign instead of zeros (_:_), and when you input the values, the _ signs will disappear.

...

Step 4: Editor Form Layout

If you want, you can switch to the Editor Form Layout tab. Here you can review what the form for creating a new record will look like in the Customized Topics datagroup.

Click the Customize button:

...


You can also change the layout template.

...

  •  change field name positions using right-click menu commands: 

...

  • add auxiliary items

    image-20250204-091856.pngImage Added

Click ↩ to undo the action.

...

  1. After a new customized topic code in General Codes Tables (GCT) is created, a new table is added to the database, like dbo.PW001UXX (where XX is the sequential number) - further U01.

  2. With replication, only a code to GCT is replicated. If you want to add this topic for a person you will get a message that table U01 is not found.

  3. To fix the error in point 2 you need to open GCT > Customized > Topics, go to the code in question, open it, make any change (e.g. add and remove the space in the name) and confirm.
    The message will say that table U01 doesn't exist and if you want to recreate it, that is successfully done after clicking OK.

  4. None of the updates are replicated until you set up the replication.
    Don't enable replication tasks on any sites until database structure is in synchrony on all sites!!

...

  1. Recreate a table manually (see Point 3 above).

  2. Create missing fields (repl_ModifiedBySite, repl_ModifiedDate, repl_GMTModifiEDDate) with the help of the below script.

  3. Open SQL Manager Studio or another tool and run new query for corresponding database (e.g. Adonis):

    Code Block
    ALTER TABLE dbo.PW001uXX ADD repl_ModifiedBySite INT NULL, repl_ModifiedDate DATETIME NULL, 
    repl_GMTModifiEDDate DATETIME NULL 
    GO


    where XX is the sequential number, e.g. PW001U01, PW001U02, etc

  4. Create missing triggers (TI, TU, BD – for insert, update, delete) with the below scripts.

  5. Open SQL Manager Studio or another tool and run new query for corresponding database (e.g. Adonis):

    Code Block
    CREATE TRIGGER [dbo].[TI_PW001uXX] ON [dbo].[PW001uXX] FOR INSERT
    
    AS
    
    SET NOCOUNT ON
    
    DECLARE @nSite as Varchar(8) , @PKeys as Varchar(300), @insGMT as DateTime
    
    BEGIN
    
    IF system_user != 'REPL' BEGIN
    
    SELECT @nSite=SITENR FROM repl_SITE WHERE IsCurrentSite = 1;
    
    UPDATE dbo.PW001uXX SET repl_ModifiedBySite = @nSite, repl_ModifiedDate = GetDate(), repl_gmtmodifieddate = GETUTCDATE()
    
    FROM dbo.PW001uXX, inserted
    
    WHERE dbo.PW001uXX.SEQUENCENO=inserted.SEQUENCENO
    
    END ELSE
    
    if substring([dbo].[ad_ReplicatorVersion](),1,1) < 4
    
    BEGIN
    
    SET @Pkeys = (SELECT LTRIM(STR(inserted.SEQUENCENO)) FROM inserted)
    
    SET @insGMT = (SELECT inserted.REPL_GMTMODIFIEDDATE FROM inserted)
    
    IF EXISTS (SELECT * FROM dbo.Repl_Deleted_Log where TABLENAME = 'dbo.PW001uXX' AND PKS=@PKeys AND GMTMODIFIEDDATE>@insGMT)
    
                   ROLLBACK TRANSACTION
    
    END
    
    END
    
    GO


    Where XX is the sequential number, e.g. PW001U01, PW001U02, etc.

    Code Block
    CREATE TRIGGER [dbo].[BD_PW001uXX] ON [dbo].[PW001uXX]
    
    FOR DELETE AS
    
    SET NOCOUNT ON
    
    IF SYSTEM_USER <> 'REPL'
    
    BEGIN
    
    DECLARE
    
    @SiteNr Integer,
    
    @SqlStat Varchar(3000),
    
    @Pkeys Varchar(300),
    
    @RowId numeric;
    
    DECLARE crs_Deleted CURSOR
    
    FOR
    
    SELECT 'DELETE FROM dbo.PW001uXX WHERE '+' dbo.PW001uXX.SEQUENCENO='+LTRIM(STR(deleted.SEQUENCENO))+' AND (( REPL_GMTMODIFIEDDATE < ''' + RTRIM(CONVERT(CHAR,GETUTCDATE(),121)) + ''')
    
    OR (REPL_GMTMODIFIEDDATE IS NULL)) ' FROM deleted;
    
    OPEN crs_Deleted;
    
    DECLARE crs_Deleted_Pkeys CURSOR
    
    FOR
    
    SELECT LTRIM(STR(deleted.SEQUENCENO)) FROM deleted;
    
    OPEN crs_Deleted_Pkeys;
    
    SELECT @SiteNr=SiteNr FROM dbo.repl_SITE WHERE IsCurrentSite = 1;
    
    FETCH NEXT FROM crs_Deleted INTO @SqlStat;
    
    WHILE (@@FETCH_STATUS <> -1)
    
    BEGIN
    
    Exec repl_GenerateRowId @RowId OUTPUT;
    
    INSERT INTO dbo.repl_Deleted (PK,SiteNr,Select_Stat,repl_ModifiedBySite,repl_ModifiedDate)
    
    VALUES((@SiteNr*10000000)+@RowId,@SiteNr,@SqlStat,@SiteNr,GETDATE());
    
    FETCH NEXT FROM crs_Deleted INTO @SqlStat;
    
    END
    
    CLOSE crs_Deleted;
    
    FETCH NEXT FROM crs_Deleted_Pkeys INTO @Pkeys;
    
    WHILE (@@FETCH_STATUS <> -1)
    
    BEGIN
    
    INSERT INTO dbo.Repl_Deleted_Log (TABLENAME, PKS, GMTMODIFIEDDATE)
    
    VALUES('dbo.PW001uXX' ,@Pkeys, GETUTCDATE());
    
    FETCH NEXT FROM crs_Deleted_Pkeys INTO @Pkeys;
    
    END
    
    CLOSE crs_Deleted_Pkeys;
    
    DEALLOCATE crs_Deleted;
    
    DEALLOCATE crs_Deleted_Pkeys;
    
    END
    
    ELSE
    
    BEGIN
    
    DECLARE @gmtDate DATETIME
    
    DECLARE crs_Deleted_Pkeys CURSOR
    
    FOR SELECT LTRIM(STR(deleted.SEQUENCENO)) ,REPL_GMTMODIFIEDDATE FROM deleted;
    
    OPEN crs_Deleted_Pkeys;
    
    FETCH NEXT FROM crs_Deleted_Pkeys INTO @Pkeys, @gmtDate;
    
    WHILE (@@FETCH_STATUS <> -1)
    
    BEGIN
    
    INSERT INTO dbo.Repl_Deleted_Log (TABLENAME, PKS, GMTMODIFIEDDATE)
    
    VALUES ('dbo.PW001uXX' ,@Pkeys,@gmtDate);
    
    FETCH NEXT FROM crs_Deleted_Pkeys INTO @Pkeys,@gmtDate;
    
    END
    
    CLOSE crs_Deleted_Pkeys;
    
    DEALLOCATE crs_Deleted_Pkeys;
    
    END
    
    GO

  6. Add necessary Task Direction Types and Replication Tasks manually to APM > SETUP > Adonis Replicator (see example below).

    ! Note: All Task Direction Types and Replication Tasks should be identical on all sites (numbers, names, queries, import table names, etc.)

    Standard query for HOST_ tasks is

    Code Block
    SELECT * FROM dbo.PW001UXX WHERE repl_ModifiedDate >= #LR# AND repl_ModifiedBySite <> #DSN#


    Standard query for SAT_ tasks is

    Code Block
    SELECT * FROM dbo.PW001UXX WHERE repl_ModifiedDate >= #LR# AND repl_ModifiedBySite = #CSN#


    Where XX is the sequential number, e.g. PW001U01, PW001U02, etc.

  7. Adjust/synchronize column names on all sites for all customized topics tables.

    Open SQL Manager Studio or another tool, find a table in question, expand the Column list and update the new column name accordingly (as it is replicated with the wrong name, like REPLFIELD_UFIELD7, but on originated site, it is added to the database with name UFIELD7).



    ! Note: You need to follow the procedure described in point 4 with every newly added customized topic.

  8. Once followed all above steps, replication tasks and direction types can be enabled (set the check-boxes in Active column) to make sure that replication is working fine.

...

There are two optional ways of Customized Topics menu presentation depending on the state of Display Customized Topics as Drop-Down List global option:

...