Skip to content

Configuration Options

Global Settings

The JustOn Self-Service Extension can be configured using the custom setting Global Settings. The Default record holds the default settings for your site.

To manage global settings, select Custom Settings in Setup, then open Global Settings > Manage.

Field Description
Invoice Template The invoice template for new subscriptions, specifies the name or ID of an ONB2__Template__c record.
Master Item Criteria An SOQL query condition that defines which items are master items. The MasterItemRetriever only returns items that match the criteria defined here.
ONB2__Active__c and ONB2__Subscription__c fields are exempt from the criteria. ONB2__Active__c must be true, ONB2__Subscription__c must be empty.
You can refer to account and contact fields using placeholders like
Language__c = [Account.Language__c]
Master Item Fields A comma separated list of master item fields that are to be shown on the Products page. Defaults to ONB2__Title__c,ONB2__Description__c.
Master Item Sort Order The sort order of the master items. If empty, defaults to the creation date. Accepts a valid SOQL order statement.
Subscription Building Either New or Reorder: If New is set, the extension creates a new subscription with each checkout. With Reorder, an existing subscription is used, if available.
Locale The default locale of your Force.com Site (like en-US, de-DE), used for label overrides and number/currency formatting as well as for the translations of custom labels.
Logo Name The name of the logo image file, which must be stored as a file in the Documents tab.
Home URL The URL to be opened when a user clicks the site logo or site name.
Redirect after login The URL of the page to which the user is redirected after successfully logging in. It must begin with a slash (/). Defaults to /Products.
Redirect after profile complete The URL of the page to which the user is redirected once the profile is complete. You can use parameters like /ONBSE1__Subscriptions?welcomeMessage=true.
Password Hash Iterations The number of iterations for the password hashing algorithm. Should be at least 500. Must be adjusted if there are CPU timeouts with password-based logins.
Username Field The API name of the field on the contact that holds the (optional) user name for the password-based authentication.
Pricebook Entry Sort Order The sort order of the master products. If empty, defaults to the creation date. Accepts a valid SOQL order statement.
Pricebook ID The ID of the price book whose entries are to be available on the Products page.
Restrict Salesforce users to local org If true, allows only users of the org where the self-service extension is installed. If false (default), any user with a Salesforce login can register/log in.

You can configure the navigation in the header using the custom setting Navigation.

To manage navigation settings, select Custom Settings in Setup, then open Navigation > Manage. Create a record for each page that you want to be accessible through the navigation.

Field Data Type Description
Active Checkbox Only active navigation elements are rendered.
Group Text (255) Navigation elements of the same group are combined into the same <ul> element.
Label Text (255) The link text.
Sequence Number (3,0) Elements are sorted by sequence.
Style class Text (255) The style class of the link.
URL Text (255) The url of the link.

Profile

You use the custom setting Profile to define which fields are visible, editable and required on the Profile page.

To manage profile settings, select Custom Settings in Setup, then open Profile > Manage. Create a record for each component on the Profile page.

Field Possible Values Description
Name string A unique name for the record, corresponds to the Profile page component.
Sequence positive integer A number that defines the display order of the Profile page components.
Source Account
Contact
Label
The source object: either the account or contact from the current session or a custom label.
Fieldname any account or contact field
any custom label
The field made accessible on the Profile page.
Must be enabled in the Public Access Settings of the Force.com site.
The following field types are supported: text, picklist, checkbox. All other types are rendered as text fields.
Required (checkbox) true
false
Used to mark a field as required even if it is not required on the database level.
Read only (checkbox) true
false
Used to disallow modifying the field, showing it for information only.
Rendered (controlling field) Account.Criteria__c
Contact.Criteria__c
Used to mark a field as to be rendered only if the criteria field on the account or contact returns true.
The criteria field must be a checkbox or formula field to return a boolean value.
The criteria field must be added to the Public Access Settings of the Force.com site.

CSS Customization

You can customize the CSS of each page. To this end, the JustOn Self-Service Extension provides the custom object Style.

Field Description
Pages A multi-select picklist including all available pages. You can select multiple pages at once. If All is selected, the style is used on all pages.
Sequence If multiple styles apply to one page, they are ordered ascending by sequence. Styles with a greater sequence number override styles with lower sequence numbers.
Content The actual CSS to be applied.

To add, for example, a logo to the payment page, you can use the following CSS code:

.content::before {
    content: url(<image_path>);
    display: block;
    text-align: center;
}

Info

You can use static resources for background images like, for example:

body {
    background: url({!$Resource.MyBgImage});
}
.content {
    background: url({!URLFOR($Resource.SelfServiceAssets, '/images/content_bg.png')})
}

JavaScript Injection

You can add JavaScript snippets to each page. Each snippet is wrapped into its own <script> tag. jQuery is injected to each page and can be used with the snippets.

To support this, the JustOn Self-Service Extension provides the custom object Script.

Field Description
Pages A multi-select picklist including all available pages. You can select multiple pages at once. If All is selected, the script is added to all pages.
Content The actual JavaScript snippet to be added.

Example JavaScript:

$(document).ready(function() {
    $('body').css('background', 'red');
});

Custom Labels

The example implementation of the JustOn Self-Service Extension makes use of custom labels. The custom labels can contain up to 1000 characters and can include HTML markup.

The custom labels of the example implementation are intended to be overwritten.

Note

To modify custom labels, you must enable the Translation Workbench. For details, see Enable and Disable the Translation Workbench in the Salesforce Help.

  1. In Setup, open the Custom Labels list.
    In Salesforce Lightning, navigate to User Interface > Custom Labels.
    In Salesforce Classic, navigate to Create > Custom Labels.
  2. Click the name of the label you want to modify.
    To better find the relevant labels, create a filter for the namespace ONBSE1.
  3. Click New Local Translations/Overrides.
  4. Select the target language and specify the text as required.
  5. Click Save.

Info

For help about modifying custom labels, see Create and Edit Custom Labels in the Salesforce Help.

Note

Set the locale in the global settings in order to select the intended translation.

Multiple Languages

The JustOn Self-Service Extension supports multiple languages.

The system shows a language switcher if there is more than one language with a label configured. The language switcher is prefixed with the ChangeLanguage custom label.

When a user accesses the site for the first time, the system tries to match the browser language and find a appropriate site language. The language is either a configured language with a label or the default locale defined in the global settings.

The language is stored in a cookie in the browser. If the user switches the language at the site, the content of the cookie is updated, and the page reloads with the selected language.

Enabling Languages

Languages are enabled using the custom setting Languages.

To manage language settings, select Custom Settings in Setup, then open Languages > Manage. Create a record for each language you intend to support.

Field Possible Values Description
Name IETF language tag
de, de-CH, fr, en-US
The language must be a supported Salesforce platform language.
Label UI display name
Deutsch, English, Español
Only languages with a label are shown in the language switcher of the UI.
The label should contain the native name of the language to help the user to find their own language quickly (like Español instead of Spanish).
Map to IETF language tag A fallback language - if a user requests the site with en-GB, it can be served using en.
The language defined here must be present and must have a label to show up in the UI.

Note

Make sure to add and enable the languages in the Translation Workbench. For details, see Add Translated Languages and Translators in the Salesforce Help.

Example Configuration
NameLabelMap toDescription
deDeutschEnable German as language and show it in the UI
de-CHdeMap every Swiss-German request to the default German language
esEspañolEnable Spanish as language and show it in the UI
en-USEnglish (US)Enable American English as language and show it in the UI
en-GBEnglish (UK)Enable British English as language and show it in the UI
enen-USMap every English request to the default American English language

Translating

Object field labels can be translated using the Translation Workbench. For details, see Translate Terms in the Salesforce Help.

Custom labels can be translated when configuring the site. For details, see Custom Labels.

Field labels for the profile page can also be overwritten and translated. For details, see Profile.

Product translations are achieved via translation fields:

Product Field Product Translation Field Example for de Example for en-US
Name Name_<lang>__c Name_de__c Name_enUS__c
Description Description_<lang>__c Description_de__c Description_enUS__c

If the translation fields are empty or missing, the system falls back to the default fields.

Note

When you create the translation fields, make sure to include them in your permission set and to add them to the JustOn Field Whitelist custom setting.

Master Items

Master items are items that are not linked to a subscription. They are intended to be available on the Products page for checkout.

Master items must match the following criteria:

  • they are not linked to a subscription
  • they must be active
  • they must match the criteria defined in the global setting Master Item Criteria

Master items are sorted by their creation date or the criteria defined in the global setting Master Item Sort Order.

Master Products

Master products are products from specific price books that are to be available on the Products page for checkout.

The price book as the "source" for the master products is configured in the global setting Pricebook ID.

The price book can, however, be overwritten on the account. To this end, create a lookup field on the account for the price book with the name ON_PriceBook__c. For help about creating fields, see Managing Object Fields.

Master products must match the following criteria:

  • Price book is linked to the global settings or the account
  • Price book is active
  • Price book entry is active

Master products are sorted by their creation date or the criteria defined in the global setting Pricebook Entry Sort Order.

Field Mapping: Master Product - Item

Master products are converted to items once they are retrieved from the database. The following field mapping is used:

Price Book Entry/Product FieldItem FieldDescription
Product2.ProductCodeNameThe order number of the item
Product2.NameTitle
Product2.DescriptionDescription
Product2.FamilyProduct Group
PricebookEntry.UnitPricePrice
PricebookEntry.CurrencyIsoCodeCurrencyIsoCodeOnly in multi-currency orgs
Product2.IdON_Product (Lookup Product2)Only if the field is available on the item
Product2.ON_ProductType__cON_ProductType__cBoth fields must be present in order to make the cart fields by type configuration work
Product2.ON_*matching fieldsON fields are copied from the product to the item if they are available