'MacroName:BatchAction 'MacroDescription:Execute OCLC actions on a batch of records 'Macro created by: Joel Hahn, Niles Public Library District 'Last updated: 10 October 2003 Sub Main Dim CS as Object Set CS = CreateObject("Connex.Client") bool = CS.ItemType If bool <> 7 Then MsgBox "Not viewing an online save file list. Exiting..." Goto Done End If Dim arrWStatus$(4) arrWStatus(0) = " " : arrWStatus(1) = "Completed" : arrWStatus(2) = "In Process" arrWStatus(3) = "In Review" : arrWStatus(4) = "New" GetChanges: Begin Dialog newdlg2 135, 189, "Enter actions to take on each record" CheckBox 6, 2, 60, 9, "Update holdings", .UHolds CheckBox 6, 15, 57, 9, "Delete holdings", .DHolds CheckBox 6, 27, 100, 8, "Produce and update holdings", .ProdUHolds CheckBox 6, 38, 126, 10, "Alternate produce and update holdings", .AltProdUHolds CheckBox 6, 51, 26, 10, "Lock", .Lock CheckBox 6, 64, 52, 12, "Release lock", .Unlock CheckBox 6, 79, 58, 10, "Replace record", .Replace CheckBox 6, 92, 123, 10, "Replace record and update holdings", .ReplaceUHolds CheckBox 6, 106, 105, 10, "Save/resave to online save file", .SaveOnline CheckBox 6, 119, 58, 10, "Export", .Export CheckBox 6, 132, 58, 10, "Validate", .Validate CheckBox 6, 144, 53, 10, "Set MyStatus:", .SetStatus TextBox 60, 145, 72, 10, .MyStatus CheckBox 6, 156, 73, 10, "Set Workflow Status:", .SetWfStatus DropListBox 83, 156, 47, 60, arrWStatus$(), .WfStatus OkButton 6, 172, 50, 14 CancelButton 72, 172, 50, 14 End Dialog Dim ChangeInfo as newdlg2 retval = Dialog (ChangeInfo) If retval = 0 then Goto Done MakeChanges: bool = CS.GetFirstItem If bool = FALSE then MsgBox "First record could not be opened. Exiting..." Goto Done End If nextrec=TRUE Do While nextrec = TRUE If ChangeInfo.UHolds = 1 Then bool = CS.UpdateHoldings If ChangeInfo.DHolds = 1 Then bool = CS.DeleteHoldings If ChangeInfo.ProdUHolds = 1 Then bool = CS.ProductAndUpdateHoldings If ChangeInfo.AltProdUHolds = 1 Then bool = CS.AltProduceAndUpdateHoldings If ChangeInfo.Lock = 1 Then bool = CS.Lock If ChangeInfo.Unlock = 1 Then bool = CS.ReleaseRecordLock If ChangeInfo.Replace = 1 Then bool = CS.ReplaceRecord If ChangeInfo.ReplaceUHolds = 1 Then bool = CS.ReplaceAndUpdateHoldings If ChangeInfo.SaveOnline = 1 Then bool = CS.SaveOnline If ChangeInfo.Export = 1 Then bool = CS.Export If ChangeInfo.Validate = 1 Then bool = CS.Validate(ErrList$) If ChangeInfo.SetStatus = 1 Then bool = CS.SetMyStatus(ChangeInfo.MyStatus) If ChangeInfo.SetWfStatus = 1 And ChangeInfo.WfStatus > 0 Then bool = CS.SetWorkflowStatus(arrWStatus(ChangeInfo.WfStatus)) bool = CS.SaveOnline End If Looper: nextrec = CS.GetNextItem If nextrec = FALSE Then Exit Do Loop bool = CS.CloseRecord(TRUE) Done: End Sub