PolarisUI - Scoped
-
- UpdatedJan 30, 2025
- 3 minutes to read
- Yokohama
- API reference
The PolarisUI API provides methods for enabling Next Experience on direct UI pages.
A UI page [sys_ui_page] is direct if the Direct field is Selected. A direct UI page doesn't include the common HTML page template and must include all CSS and JavaScript that you want to use in the page.
All non-direct UI pages use Next Experience by default.
For more information about Next Experience, see the Next Experience UI.
The PolarisUI API is provided within the sn_ui
namespace.
PolarisUI - canUsePolarisCSS()
Checks if the current page can use the Next Experience UI.
true
if all of the following conditions are met.- sn_ui.PolarisUI.isEnabled() is
true
. - The request URL parameter sysparm_use_polaris is not set to
false
. - The referrer HTTP request header does not contain
sysparm_use_polaris=false
. - The page or its parent plugin are not denied use of Next Experience by a record in the Page Theme Support [sys_page_theme] table.
Use this method to conditionally change behavior or jelly output if Next Experience is enabled.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | Flag that indicates whether the current page can use the Next Experience UI. Valid values:
|
Example
This UI Action redirects to a different page if Next Experience is running on the current form.
Example
This jelly script sets a different style sheet for pages using Next Experience.
PolarisUI - getBodyClassNames()
Returns a list of CSS class names used by the Next Experience UI.
<body>
tag of a UI page to set the CSS
classes required for Next Experience to render
correctly.The returned class names change depending on system properties and if session debug output exists.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
String | List of CSS class names used by the Next Experience UI. |
Example
This jelly script adds Next Experience to a custom UI page.
PolarisUI - isEnabled()
Checks if the Next Experience UI is enabled for the current user.
- glide.ui.polaris.experience enables Next Experience on the instance.
- glide.ui.polaris.use disables Next Experience for specified users when set to false.
Name | Type | Description |
---|---|---|
None |
Type | Description |
---|---|
Boolean | Flag that indicates whether the Next Experience UI is enabled for the current user. Valid values:
|
Example
This UI page displays a conditional message to the user if Next Experience is enabled for the current user.
Example
This business rule shows an info message on record display that a user can click to view
the record in Core UI instead of Next Experience. The business rule
Condition field is set to !current.isNewRecord() &&
sn_ui.PolarisUI.isEnabled() && sn_ui.PolarisUI.canUsePolarisCSS()
.