2

I am new to salesforce and I have already gained some experienced writing apex code to get things working, but then it was pointed out to me that certain things can be done using process builder and I dont have to code for anything. I've never used process builder before and I was wondering if the below process is easy to enough to create using process builder.

Here is the requirement:

Salesforce does not automatically match the "Student Email (Case)" field against the Contact's Email or Alternate Email. Please add a process to lookup and associate a Contact to a Case based on the email listed in Student Email (Case). This should happen after the Case is created.

If there are no matches by that Student Email (Case), leave the Contact blank. If there is an exact match, associate the case with the matching Contact.

5

Unfortunately, Process Builder doesn't have the capability to query the existing records by itself. However, Flow does. You could create a flow that sets the email as a variable and then queries it.

It's best to use declarative tools if you think the requirements will change very frequently. Or if you'd like to empower a non-coding System Admin to make changes.

But if the above considerations don't apply, I'd just code it in Apex. The code will better handle edge-cases such as multiple returned results. And the unit tests will help you avoid keying in records over and over during your testing.

I hope this helps!

1
  • You were right. And I ended up doing it using apex anyway
    – manb
    Nov 5 '20 at 17:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.