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
Umut OzerenUmut Ozeren 

Do a Lookup on All Accounts using a custom field

I am a part time Salesforce admin with no Apex knowledge. I don't even know if this is the right place to post this. Did my research, but couldn't find this information.

Problem is this: We have a native database that has unique identifiers for each of our customers. Whenever we get usage etc. notifications, this identifier is emailed to us. 

For sake of simplicity, let's say this unique identifier is 'google.com' and Google is recorded in Salesforce with a unique ID of "2019" (auto-generated). I created a custom field under Accounts "Native Database ID" and entered 'google.com'.

When I am using Zapier or webform integrations, this 'google.com' is sent to Salesforce. However to, dynamically link activities or Lookup fields, Salesforce requires Salesforce IDs.

So whenever a new submission happens, I want Salesforce to do a lookup on all our Accounts for the field Native Database ID, and when it finds a match, populate that Account.

I know that Zapier has a "Find Account" feature under Salesforce integration, but with our volume, using this additional step is costly. Also, we don't use Zapier for every automation. Essentially, what I am trying to build is similar to Zapier's "Find Account".

Is this doable w/o Apex? If not, is there any guides you can direct me to learn this part of Apex?

Thanks,

Vladimir SaturaVladimir Satura
Not sure how are you exactly populating the lookups, but you can change your new field to be 'External Id' and then it can be used instead of Salesforce ID.

Take a look if any of these will be helpful for your case

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/langCon_apex_dml_nested_object.htm
https://douglascayers.com/2016/02/07/salesforce-power-of-upsert-and-external-ids-part-2/
https://getsatisfaction.com/dbamp/topics/use_external_id_for_lookup_field_instead_of_salesforce_id
Umut OzerenUmut Ozeren
Hi, thanks for your reply.I am not populating the lookups.What I want to do is to populate this using a temporary field. Then fire up a Salesforce trigger / workflow that populates the lookup fields.
Vladimir SaturaVladimir Satura
I'm not sure what you want to achieve in that case. Can you explain it in more detail?