function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
David K.David K. 

Lightning connect indirect lookup with duplicates?

Trying to use salesforce/Lightning connect to access external data in an Oracle Database.

Our challenge is that we have multiple Salesforce accounts that are reference a single external account id.

So in Salesforce there are 2 accounts that both use account "A5"
We can't make the external ID field unique because of this.

If the external id is not unique, it is not available in Lightning connect.

Has anyone had experience with this and a possible workaround?

Thanks,

Dave K.

VinayVinay (Salesforce Developers) 
Hi David,

Indirect lookup relationship between salesforce object and external object, there needs to be an externl id that can be used to match the data.  So you need external id field to use salesforce connect.

As a workaround you can try to merge records.  Review below links which has more informaion on Merging Records.

https://developer.salesforce.com/forums/?id=906F0000000MLu3IAG 
https://success.salesforce.com/answers?id=9063A000000DmwsQAC 
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_examples_merge.htm
https://salesforce.stackexchange.com/questions/251324/merge-method-in-apex 

Hope above information was helpful.

Please mark as Best Answer so that it can help others in the future.

Thanks,
Vinay Kumar