Lightning Navigation Button

Declaratively add buttons to lightning flows, screens or communities

We created the Advanced Navigation button to fill a need in the user base.  Salesforce is fantastic out of the box but there are limitations in particular with buttons.  This managed package looks to meet some of those needs using clicks and not code.

The Advanced Navigation button, dubbed the “Magic button” by some, can be used for a variety of uses:

  1. Add bespoke navigation options in a flow. For example, replace the “Next” button with a “Save and View” button.
  2. Launch new record or edit page. For example, launch the create new account page with a specific record type.
  3. Auto launch a quick action. For example, automatically launch the new opportunity quick action when an account with the type “prospect” is created.
  4. Navigate to another page. For example, auto navigate to another record page when a certain status is reached.

Design

The Advanced Navigation button allows the user to change the appearance and text on the button.

“Button Style”

Preset styles shown below, an easy way to style up a simple button without any further work required. See documentation.

“Button Label”

Choose what text should appear in the button itself.  Text choices on buttons have traditionally been limited in Salesforce, and this removes that limitation to an extent.  You can choose to have “Save”, “Apply”, “Click this here”, “You are wonderful”, whatever text you deem suitable.

“Button CSS style”

Specify the style using CSS if using “text”.  If text is not used i specifieds the style of the div containing the button.  At present it is not yet possible to add styles directly to the button.

Utility Actions

“Auto Start without button press”

Exactly as the name states.  It will auto-launch your chosen functionality, eg: flow or redirect without any user interaction.  You can have this on a page where you want an action to kick off as soon as the page launches to streamline processes.

“Navigate to URL”

This nifty action will guide the user to the specified URL/page when they click on the button.  Say you want the finish action to take them to a specific website or another record page, this is a really easy way to do it.

“Launch a quick action”

This is an extremely useful functionality where you can use the button to launch a quick action: For example: add a task on a new opportunity, or create an invoice on a won opportunity.  The quick action does need to be on the page layout for this to work, and this needs to be populated with the API name of the quick action

“Flow action”

Expands your choices beyond the standard Flow buttons. You can turn them off and use the Navigation Button to set the flow action to either: next, back, pause, or finish.  See docs.

“Output: Button Clicked?”

Use this to ascertain if a button is clicked in a flow. When the button is clicked it will set the variable here to true. This is useful if you have multiple buttons on the page to see which button was clicked on the flow screen.  

“New Record:Object Name”

If you want to launch the create a record screen enter the object name here.

“New Record:Recordtype ID”

Only populate if you want to create a record. Enter the record ID to use. This alters picklist values and page layout choices.

“New Record:Predefined Variables”

You can prefill fields on the page. To do so add in the values in a JSON style format. Field:Value. “APiFieldName:Value,APiFieldName:Value”

For example, “FirstName:Ben” or “FirstName,Ben,LastName:Smith”

“Edit: Specific record Id to edit”

If you want to edit you can pass a specific record ID through to edit that record. For example a related record.
If blank it uses the recordId from the page it is on

“Edit:Do you want to edit a record?”

Mark as true if you want to launch the edit record page.

Send email-alerts and log the email.

Use process build, flow or apex to send an email

See the sent email in the activity feed

 

 

We strongly recommend using Flows to send emails – they are better than process builders and easier to debug.

 

#1 Install

  • Upvote the idea for Salesforce to make this standard.
  • Install the package – this only works on Enterprise edition and up as it requires apex code. Or view in GitHub.
  • Open a process builder (or flow)
  • On the actions select the “Apex Class” option

#2 Select the recipients

  • Related To ID – the ID of the record you want to relate this to (eg. account or opportunity). Not a contact, lead or user
  • Contact/Lead ID – Required if you use an email template
  • ‘To – To Addresses’– enter a comma-separated list of email address. Eg. dan@salesforce.com, bob@smith.com
  • ‘To – bcc Email Addresses’– comma-separated list of email addresses to go into the BCC field
  • ‘To – cc Email Addresses’ – comma-separated list of email addresses to go into the CC field
  • ‘TreatTargetObjectAsRecipient’ – true or false – if false it won’t send the email to the contact or lead

#3 Enter the email content

  • ‘Body – Template Id’  – the id of the email template. eg. 00X600000012maf
  • Or instead, use ‘Body – Template Unique Name’ with the unique name (API name) of the email template. eg. “Email_template_name”

Or write your own content. You cannot use custom content with an email template due to a limitation in Salesforce Apex:

  • Subject – specify the subject
  • ‘Body – Plain Text ‘ – enter a plain text body
  • ‘Body – Html’ – or an HTML body
  • ‘Body – Use Signature’ – include the user’s standard signature

#4 Attachments

  • ‘Attachment – ContentDocument – Comma Separated Ids’ — This is the ContentDocumentId of the document you want to attach. It will take the latest ContentVerion.
  • ‘Attachment – ContentVersion – Comma Seperated Ids’ to specify a specific ContentVersionId
  • ‘Attachment – Comma Separated Ids’ – List of Attachment Ids

#5 Optional Extras

  • ‘From – Org Wide Email Address’ – Specify a specific from address. This must be an org wide email address.
  • ‘Setting – Save As Activity’ – You decide if you want to log the email as an activity or not. Defaults to True
  • ‘Setting – Apex Error Email’ – Send an email to the specified address containing all errors
  • ‘Setting – email Opt Out Policy’- this helps define what you do if a user has opted out of receiving email

Limitations

  • You cannot use Email Templates without a Lead or Contact Id. This is a limitation of Salesforce Apex code. One workaround is to create a dummy contact. We know this is not ideal
  • Apex email sends have a limit of 5000 per day across your org. Note that all recipients in the to, cc and bcc fields count against this limit  An example being an email with 2 addresses in the “to” field and 1 address in the “cc” field would count as 3 calls against the limit.

Demo