Copy Record Link between databases

In my current upgrade process I needed to copy the Record Link table from one database to another.  I can use a copy-paste method for small number of records but in this case I needed something else.

A Dataport or a XML Port was the way I choose to go.  There is one problem though.  the Record Link table has a field for the Record ID and this field is not a field type that can be used in dataports or xml ports.

I created two new global variables, one text variable for the record position and one integer variable for the table number.  And to help me with the conversion I needed to have two more global variables; RecID  and RecRef.


Now for the code.  To convert my Record ID field to a record position and a table number


and to convert from the table number and position to a Record ID


One Reply to “Copy Record Link between databases”

  1. I use something like follows on different table:

    Record Link – OnBeforeExportRecord()
    StrRecordID := FORMAT(“Record ID”);

    Record Link – OnAfterImportRecord()
    EVALUATE(“Record ID”,StrRecordID);

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.