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
onthebeachonthebeach 

Regular Expressions

I'd like to emulate the account/contact import matching & de-duping rules. I would think the query language would need to support regular expressions. Since it does not, is there another way to do server-side pattern matching?

thanks.
GlennWGlennW

You are very limited to the type of calls you can do with a = or like comparison in SOQL.  I would recommend an initial filter of the data (if you know the name starts with "a" just bring down (name like 'a%') accounts but in most cases you'll want to pull down all accounts.

Your best bet is to pull down a large number of account names and then work on the account names by pulling them into an inline database and performing your RegEx matches there plus other cleaning functions.

Cheers;
GlennW
www.demandtools.com

onthebeachonthebeach
Thanks for the idea.

Do you have any idea how a product like Data Junction would import, say, opportunities and match them to an account using salesforce's regular matching rules?

So, an opp with company name "ABC" would match to an acct with name "The ABC company"
GlennWGlennW

I'm not sure how Salesforce does it but we do a mixture of prefix replacing, sufix replacing, RegEx matches and even a bit of "fuzzy" matching to account for spelling mistakes.

Your best bet is to try to keep the Id's through your process so that you can key in on that unique field.

Cheers;
GlennW
www.demandtools.com

adamgadamg
Take a look at the SOSL doc to see if that helps as well..

..when I've done simple deduping work, I've query'ed for a specific email address and see if I get any records back - what you need to do depends on your dedup algorithm..