I have the need to create a function that works through a list of tables/fields and change those field values where necessary based upon a conversion table.
I have come across a bit of a problem where the field that needs to be changed is in the primary key. I cannot use rename, as suggested, as I am working with RecordRefs, not Records.
I came across the SETPOSITION function which seems to indicate that this should change the values in the key fields.
I have put together some code that compiles OK and does not return any errors, but it is not retaining the new values.
Could someone please advise on how this function should be used?
strTemp := tblTableRef.GETPOSITION;
strNo := STRPOS(strTemp,OldID);
strTemp := DELSTR(strTemp,strNo,STRLEN(OldID));
strTemp := INSSTR(strTemp,NewID,strNo);
Note: I have set messages/ error to let it run once and show me what it is doing. These will be removed.
Server - 3.70.B
Client - 3.60