Send Salesforce Survey Without Code

Send Salesforce Survey using Flow and Process Builder

Salesforce Survey is available in Health Cloud & Financial Service Cloud otherwise its paid. Community Cloud is also required to use Survey.  If you need to practice Survey, create a 30 day trial org from this URL (mentioned in this trailhead module). One Survey can be created and used in Enterprise and Unlimited edition, so if you need only one survey then its free. In my case, I had to send same question to every customer on Case close , so it was free.

Prerequisite to use Salesforce Survey

Step 1 – Enable & create Community. Once community setup is done, we would need to activate it. Community can be created by any template. It can be blank as well, if it’s being created only for survey.

Step 2 – Enable Salesforce survey by navigating to Admin setup. You would need to select Community, which would be used by Survey to compute public unique link.

Salesforce - Enable Survey
Salesforce – Enable Survey

Send Visualforce as an email attachment from Apex Trigger – Alternate design

Send Visualforce as an email attachment from Apex Trigger

Previously I had written same blog post and it was working fine before Winter 16. However, after Winter 16 critical update was released by Salesforce to consider getContent() method as a callout. If this update is enabled in your Salesforce instance then my previous blog post will not work.

In this blog post, we will go through alternate design, where we would still be able to send Visualforce page content as an Email attachment. Difference is, instead of Apex Trigger , Invocable Method and Process builder will help us getting there.

Again, consider below simple Visualforce page, which we want to send as an attachment.

Summer 16 – Process builder with multiple decision criteria

Before going to this feature, lets try to outline problem first. Consider a situation where we need to create a task when lead  source is Email and send an email to owner if lead source is Email and company name as ABC.

If we try to solve it using process builder, very soon we will understand that it is not possible in one process builder. Process builder can have only one criteria with true and false condition. In previous process builder, we could either perform action if lead source is Email or lead source is Email and company ABC. There is no way to define new criteria which will run along with previous criteria as shown in below image.

Process Builder Before Summer 16 with Single descision criteria
Process Builder Before Summer 16 with Single decision criteria

Why to avoid using Workflow rule and Process Builder field update with Trigger

Workflow rule and Process builder are the tools because of which Salesforce Admins can perform so many tasks, which were only possible by writing Triggers. Before release of Process builder, if we wanted to perform field update on child records or post chatter messages or auto execute Visual Flow, Triggers were used by developers.

As a best practice in Salesforce, it is always suggested that we should prefer “point and clicks” over code. Indirectly, prefer Workflow rule or Process builder over Triggers.

Trigger Workflow and Process Builder in Salesforce
Trigger, Workflow and Process Builder in Salesforce

In this post, I will explain a scenario where above statement will not stand true.