Affects Version/s: None
Fix Version/s: 1.3
Users need to be able to import data which is specifically intended to update and/or insert new info for existing contacts. To facilitate this we will allow explicit mapping of the 'Internal Contact ID' during import.
1. Add 'Internal Contact ID' to the field mapping select values.
2. When this field is included as a mapped column, row-level processing is modified as follows:
2.1 If the mapped contact_id field is NOT populated for a row, use the current processing rules (e.g. validate for required fields, check for match/dupe, and insert, skip, update, fill, ignore... depending on user-specified Duplicate handling mode)
2.2 If the mapped contact_id cell DOES HAVE a value, we will NOT validate against minimum field requirements (e.g. First/Last Name OR email address). We will still call the dupe-checking function. HOWEVER, we will ignore the selected Duplicate Handling method (Skip, Update...) and follow these rules for the row:
- If dupe matching returns a single matching contact, verify that the ID matches the cell value. If true, update the contact object. If false, don't update and add this row to error array - "Mismatched contact ID ..."
- If multiple matches, we can still update the returned contact with the corresponding contact_id (or throw 'mismatch' error if none of them have the corresponding ID).
- If no matching contact is returned from the dupe checking, make sure a contact does exist in the DB with the corresponding contact_id. If true, update it. If false, add row to error array - "No contact found for this contact ID: 22"