lovinghouston / lwcgoogleplacesbutton

Adds a Lightning Web Component to create Google Place Listings (currently hardcoded to type "church") as a Salesforce object (currently hardcoded to a custom object named Church_School_Partnership__c).
3 stars 1 forks source link

Duplicate Churches within one Transaction (Google data return) #48

Open sungysang opened 4 years ago

sungysang commented 4 years ago

Reference: #40

Currently duplicate checks occur before churches are inserted, checking among the existing church Accounts. This means that no duplicate checking is occurring between the new records that are inserted, which could lead to duplicates if there's two similar church markers in Google Maps.

Potential Ideas: Go through the returned data (rawChurches) before the duplicate check occurs so that the list does not contain duplicates. Is there a Salesforce provided way/best practice to go through a List of records within itself to account for dupes?

sungysang commented 4 years ago

Good example record: https://lovinghouston--partial.lightning.force.com/lightning/r/Account/0011N00001qzT3iQAE/view

sungysang commented 4 years ago

FYI @Julian88Tex @Rodney-Zhu there is a fix for this issue in this branch: https://github.com/lovinghouston/lwcgoogleplacesbutton/tree/bug/ssong_internal_duplicates but Julian brought up a good point that same addresses may not necessarily mean duplicate churches, so will hold off on making a PR for this until it turns into a big issue for LH.