Use the onBackDiscardV2 attribute to exit a setup
flow without validation or saving. When onBackDiscardV2 is
set to true, pressing the back button ends the current
process without saving data or user changes, closes the flow UI, and reverts to the previous
process without returning any values.
Required Editions
Available in: Lightning Experience in Professional, Unlimited, and
Enterprise Editions that have Consumer Goods Cloud enabled.
Attributes
Important Always use the onBackDiscardV2
attribute to configure the discard handling settings for pages. When set to true, onBackDiscardV2
discards unsaved changes by default when exiting a setup flow while onBackDiscard saves data.
The table describes the onBackDiscardV2 attribute.
Attribute
Description
Values
Required?
onBackDiscardV2
Changes the discard handling for pages.
Boolean
No. The default value is false.
Sample Code
<!-- left out details for brevity -->
<Page pagePattern="SingleSectionDialogPage" cachable="false" onBackDiscardV2="false">
Did this article solve your issue?
Let us know so we can improve!
Loading
Salesforce Help | Article
Cookie Consent Manager
General Information
Required Cookies
Functional Cookies
Advertising Cookies
General Information
We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required Cookies
Always Active
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional Cookies
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising Cookies
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.