We occasionally get requests from customers about doing batch updates to donor records. We have plans to address this within GiftWorks in the future but until then it has to be done manually. This is obviously not a great answer, but since GiftWorks has an API, developers have an additional option. Below is some VBScript that formats the addresses for all donors in an individual SmartList. Because this is an example, the only formatting I show is converting all text in an address to uppercase. There's no reason the script couldn't be extended to reach out to the postal service and validate the address. I'll leave that as an exercise for the reader.
1: Const typeIndividual = 0
2:
3: ' create an instance of our application
4: Set App = CreateObject("MissionResearch.GiftWorks") 5:
6: ' Make sure the user is signed in so a db is selected
7: If App.Security.SignedIn Then
8:
9: ' make sure the user is viewing a SmartList
10: If App.Shell.History.CurrentTask.Urlpath = "/list-browse-list" Then
11:
12: ' get a reference to the current SmartList based on the id passed to the page
13: Set smartlist = App.Modules.Donor.ListManager.GetList(App.Shell.QueryString("id")) 14:
15: ' make sure we have an Individual SmartList, or error out
16: If smartlist.ContentType = typeIndividual Then
17:
18: ' get a recordset based on the SmartList
19: Set rs = smartlist.ItemList.Recordset
20:
21: ' go thru each donor
22: Dim donor, address, changed
23: Do While Not rs.EOF
24: changed = False
25: Set donor = App.Modules.Donor.DonorManage.GetIndividual(rs("id")) 26: ' go thru each address for this donor
27: For Each address In donor.Addresses
28: ' call the reformat method
29: ' this example just uppercases all text
30: changed = ReformatAddress(address)
31: ' if the address was modified, 'changed' will be True
32: Next
33: ' if any address was changed, update the entire donor
34: If changed Then
35: App.Modules.Donor.DonorManage.UpdateIndividual donor
36: End If
37: rs.MoveNext
38: Loop
39: rs.Close
40: Else
41: App.Shell.MsgBox "Must be viewing an Individual SmartList"
42: End If
43: Else
44: App.Shell.MsgBox "Must be viewing a SmartList"
45: End If
46: Else
47: App.Shell.MsgBox "You must be signed in before calling this script"
48: End If
49:
50: ' this function just uppercases all text
51: ' return True if it needs changed
52: Function ReformatAddress(Address)
53: Address.Street1 = UCase(Address.Street1)
54: Address.Street2 = UCase(Address.Street2)
55: Address.City = UCase(Address.City)
56: Address.State = UCase(Address.State)
57: Address.Zip = UCase(Address.Zip)
58: Address.Country = UCase(Address.Country)
59: ReformatAddress = True
60: End Function
61:
We have not released a GiftWorks SDK yet so there is no documentation available to show you the rest of the properties for a donor, but those that know how to use an object browser can check out the files: msdsvc.dll and gitwks.exe.