Source Code Best Practices

Follow these best practices when using source codes.


Provide the marketing/merchandising team with a clear understanding of how source code groups have been implemented within the storefront.

Testing Promotions

Implement and Document the Source Code Workflow

Develop a workflow for the build, review and release of source code groups:

Incremental Imports of Source Code Groups

Salesforce B2C Commerce supports incremental updates to the set of source code groups. This functionality is useful in cases where source code groups are provided in chunks by external systems and must be imported into B2C Commerce.


Import source code groups and their codes into Staging, test them in Staging, replicate and test in Development, and then replicate them to Production.

Using a Source Code Pattern

Do your source codes follow a pattern? If you need more then 100 source codes per source code group, we recommend that you use a source code pattern instead of individual source codes.

A source code group is a group defined by a pattern. When the system processes a source code, If the pattern matches, the source code group is recognized and activated. You don't need to add all source codes explicitly. This should be an exception, rather than the rule, and limited to a few hundred source codes. The source code group pattern is used for recognition, but the actual code is preserved and stored with the session.

Note: If your source codes do not follow a pattern, consider reimplementing your source code solution.

Suppose you have multiple source-codes (and a series of sale catalogs), and one source code is specified for each sale catalog? The storefront encompasses all of these sales catalogs and you want to direct all of the source-codes to one Outlet area of the storefront. You could:

  1. Create a Source-Code Group, for example, SALE to encompass all of the catalogs, with an initial Source-Code specification of SPRING*.
  2. Use the source-code specification of SPRING* to encompass all your source-codes with SPRING in the name, representing all Spring Sale catalogs. For example, SPRINGOUTDOOR, SPRINGHOME, SPRINGWOMENS.
  3. On the Redirects tab, associate the SALE source-code group with the category ID of the Outlet section of your storefront.

    Alternatively, you could create the same SALE Source-Code Group, and within it, create a series of source-code specifications aimed to encompass individual source-codes. For example:

    Source-code group: SALE

    Source-code specifications:
    OUTDOOR[N1..1000], HOME[N1..1000] and WOMENS[N1..1000]

    These encompass source codes OUTDOOR1 through OUTDOOR1000, and so on.

X Privacy Update: We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used. By continuing to use this site you are giving us your consent to do this. Privacy Policy.