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, pause, or finish. 

“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

#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/User ID – Required if you use an email template
  • ToAddresses – enter a comma-separated list of email address. Eg. dan@salesforce.com, bob@smith.com
  • bccAddresses – comma-separated list of email addresses to go into the BCC field
  • ccAddresses – comma-separated list of email addresses to go into the CC field

#3 Enter the email content

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

Or write your own content (you cannot the options below with an email template)

  • Subject – specify the subject
  • PlainTextBody – enter a plain text body
  • HtmlBody – or an HTML body

#4 Optional Extras

  • OrgWideEmailAddress – Specify a specific from address. This must be an org wide email address.
  • Save As Activity – You decide if you want to log the email as an activity or not. Defaults to True
  • emailOptOutPolicy – this helps define what you do if a user has opted out of receiving emails:
  • Attachment – ContentDocument — This is the ContentDocumentId of the document you want to attach. It will take the latest ContentVerion.
    • Otherwise, you can use ‘Attachment – ContentVersion’ to specify a specific ContentVersionId

Limitations

  • 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