Skip to main content
OCLC Support

ReplaceRecord

Find the syntax, use, parameters, return values, and an example for the ReplaceRecord macro command in Connexion client.
Syntax BOOL = CS.ReplaceRecord
Use to Replace an online bibliographic or authority (NACO-authorized libraries) record, or records selected in a list, with the current record.
Or
When offline, marks local record(s) for batch replace.

Same as using the Action > Replace Record menu command.
Parameters None
Comments
  • If you are logged on, this macro does the action immediately online.
  • If you are working with local file records while offline, this macro marks the current record, or records selected in a list, ready (R) to batch-process the action.
Return values TRUE if the action is successful, or FALSE if not.
Example Sub Main()

     Dim CS As Object
     Dim bResult As Integer

     Set CS = GetObject(,“Connex.Client”)

     If CS.IsOnline = False Then
          CS.Logon ““, ““, ““
     End If

     CS.Search “WC”, “#1”

     If CS.Lock = True Then

     CS.AddFieldLine 1, “500 Field added at line position 1”

     bResult = CS.ReplaceRecord

     If bResult = True Then
          MsgBox “The command completed successfully”
     Else
          MsgBox “The command did not complete successfully”
     End If
     End If
End Sub

What this example does
  • Logs on to Connexion if not already logged on, using the default authorization and password you selected in Tools > Options > Authorizations tab.
  • Searches WorldCat for record number 1.
  • Locks the original copy of record number 1.
  • Adds a new field 500 as the first line of the record, with no indicators (two blank spaces), and the text Field added at line position 1.
  • Replaces the original copy of the record (WorldCat record now contains the new field).
  • If the action is successful, returns the message: The command completed successfully. If not, returns the message: The command did not complete successfully.