Create Global Custom Preferences
In Salesforce B2C Commerce, you can create global custom preferences, and then view and edit them. Custom preferences enable organization developers to make properties of the system modules configurable in Business Manager.
They can:
- Define a preference type
- Define a preference group
- Group preference types into preference groups
- Set the value of a preference for an organization
- Read the value of a preference from a custom application (for example, a pipeline or B2C Commerce script)
One way to achieve higher flexibility when implementing customized functionality for a system is to make certain features and properties configurable. These features allow for easy adaptation of the system functionality to changing requirements later.
You can create custom preferences to make your settings
configurable. Global custom preferences are defined in the context of the
OrganizationPreference
system object.
Because these objects are defined as custom preference types, you can add attributes and values.
read-only
permission, you can view the settings, but you can't change them.
This change also applies to changes via B2C Commerce API calls.
You can also get and set custom preferences programmatically.
-
Start by creating an attribute grouping and corresponding set of attribute definitions
by selecting Administration > Site Development > System Object
Types.
-
To assign attributes to an attribute group:
-
You can set global custom preferences by selecting Administration >
Global Preferences > Custom Preferences.
- On the Global Custom Preferences Groups page, select an ID or name or click the Edit button at the right of a preference group row.
- On the Global Custom Preferences page, select the Instance Type.
- Select the preference value.
- Click Apply.