Salesforce users often require the capability to work with a number of records at once. For example, a sales user may be communicating with a number of contacts, while he/she may also be creating or deleting contacts in response to information received through a number of channels. The Salesforce enhanced list view functionality allows a set of records that share a common record type to be inline-edited, but doesn't provide a way to add or remove records.
In this recipe, we will create a Visualforce page to allow a user to edit the details of a collection of existing contact records, and create or delete records dynamically. Upon saving the list, existing records will be updated, any new records will be inserted, and any records previously deleted from the collection will also be deleted from the database.