Replacement for “Stay in Touch” using Flows
captains log : star date april 2018 – check out this new post that allows using the lightning runtime on a flow in a visualforce page in a site. New and improved y'all. Original post is below:
The native Salesforce stay-in-touch functionality is great, unless you want to change anything at all with how it works, as there is currently nothing at all that can be modified (though there is an idea with 16,000 points that you can vote for.)
In this post I will demonstrate how, by using visual workflow embedded on a public force.com site, its possible to pass in the ID of an existing contact via a URL parameter, display the values for a non-authenticated user to edit, and to save the edits back to Salesforce.
There is one major constraint to work around. Salesforce does not permit the Site Guest User to edit contacts, so you have to use a custom “holding” object along with an autolaunched flow to update the “real” contact. Autolaunched flows run in system mode, which takes care of the permissions issue!
Pulling this together requires the following components. I will (someday) write sub-posts with details on each of the steps involved.
- Flow to look up a contact, capture updates, and create a “Temporary Contact” record with the updated values
- Flow to update the “Real” contact from Temporary Contact
- Process to launch Flow #2 when Temporary Contact record is created
- Visualforce page to embed the flow on (no controller required!)
- Force.com Site to display the flow embedded on the visualforce page
- Create an email template and fire off requests for updates individually or using mass email
Some considerations on this approach
- Compound fields (addresses) and multi-select picklists may (or may not) be difficult to write from temporary contact to “real contact.” I built this using first name, last name, and email for my proof of concept and have not yet tested other field types.
- If there are issues w #2, it might be possible to have the flow create a “real” contact (as site guest user is allowed to create contacts), and then to use a tool like dupeblocker to auto-merge the dupe w/ the original.