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.

RecordLinkVariables

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

RecordLinksBeforeExport

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

RecordLinksAfterImport

One thought on “Copy Record Link between databases

  1. Sebastiaan Lubbers says:

    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

%d bloggers like this: