Contact Pickerby Dave Graham
The Contact Picker Module’s goal is to abstract the activity of searching for existing contacts, as well as adding new contacts. In most CRM solutions, it can be called from many different contexts. The first example (see Contacts Demo) is used when creating a new contact. In this scenario the picker is used to search the database first to prevent users from adding a duplicate contact. The second example (see Contacts Demo) is adding a related contact, which creates join records relating the contacts to each other. Dig in and have a look at each of the handlers to get a sense of what’s possible.
Other potential use cases is to pick a contact to attach to an email, note, or other activity record. There are an infinite amount of use cases for this picker!
Every use case will have a workflow that will need to run after the contact is picked (or created). We can’t lock the user in a pause/resume loop because the magic which performs the search will not run if a script is paused. For this reason we install a handler using the On Timer script in the contact file. The handler’s job is to “watch” the picker and resume after a contact was picked or created (or to determine if the operation was canceled).
I recommend copying the scripts out of the Contact Demo file into your own Contacts database, but the picker file should remain separate from your solution. Since it has minimal dependencies it is quite easy to integrate as a separate file, and because it’s designed to work in a pop-up window there’s almost no benefit to merging this into your primary contact database. Open the Contact Demo file first and follow the instructions in the README, then follow the instructions in the README for the Contact Picker file.