Campaign ERD of Salesforce B2C Commerce Cloud

When scouring the documentation for the Campaign ERD (Entity–relationship model) of Salesforce B2C Commerce Cloud, you have probably come out empty-handed.

Sure, you find many diagrams on the entity model of force.com with a quick Google! But not so for SFCC. That is why I started to create my own, and share them with you!

The fourth on the list: Campaigns! And this one has quite a few things to remember for such a small diagram.

Some additional explanation

Promotion relationships

You will notice that a solid line does not depict the relationships between promotion and CustomerGroup, SourceCodeGroup, and Coupon in the Campaign ERD.

This is because they are more “helper attributes/functions” made available on the entity, so you do not have to traverse all the related Campaigns yourself.

In reality, there is no direct relationship.

StoreGroup & Store

People familiar with SFCC will look confused when they see “Stores” and “StoreGroup” pop up in this Campaign ERD. (or maybe you have seen this by accident in the documentation or IntelliSense)

Even though this relationship is visible/accessible in the code, you can not assign “Store Groups” or “Stores” to a Campaign in the Business Manager.

It is also impossible to manage Store Groups from within the business manager. Or can we? It appears that this functionality is behind an undocumented feature switch!

After creating a support ticket, two new features appear in the business manager. First, we get a new administrative module!

And suddenly, within campaign management, we get new options!

campaign store groups sfcc
Campaign Details

Unfortunately, this Campaign feature does not appear to work in the storefront (I got your hopes up there, didn’t I 😉). 

I experimented with the StoreMgr.setStoreIDToSession() function, which did not activate an In-Store-only campaign. These scopes are also unavailable in the SCAPI/OCAPI, meaning we can not use them for Headless applications either.

If anyone has gotten this feature to work, please let me know on the social channels I am active on!

Import

It is possible to import this data, as described in the store.xsd file:

				
					    <xsd:complexType name="complexType.StoreGroup" mixed="false">
        <xsd:sequence>
            <xsd:element name="name" type="simpleType.Generic.String.256" minOccurs="0" maxOccurs="1" />
            <xsd:element name="stores" type="complexType.StoreList" minOccurs="0" maxOccurs="1" />
            <xsd:element name="price-books" type="complexType.PriceBookList" minOccurs="0" maxOccurs="1" />
            <xsd:element name="custom-attributes" type="sharedType.CustomAttributes" minOccurs="0" maxOccurs="1" />
        </xsd:sequence>
        <xsd:attribute name="store-group-id" type="simpleType.Generic.NonEmptyString.256" use="required" />
        <xsd:attribute name="mode" type="simpleType.ImportMode" />
    </xsd:complexType>
				
			

Slots & Sorting Rules

It is possible to assign these to a campaign in the Business Manager, but they are not accessible through code.

SlotContent, SortingRule, and PriceBook

These entities have been marked in yellow as there is a larger entity model behind them. These have been made available in other ERD posts I have done (or will do) on this blog.

More to follow?

You can be sure of that! Next is the basket and order ERD, so keep an eye out for this blog! There are still quite a few entities within Salesforce B2C Commerce Cloud, each in charge of an essential role within the entire flow.

Next up is basket and order, so keep an eye out for this blog! 

Mistakes?

Don’t you love being human? We get to make mistakes and call it part of the experience. Please don’t be shy if you spot something that needs fixing in this Campaign ERD. Let me know!

Newsletters surrounded by cogwheels

Table of Contents

Facebook
Twitter
LinkedIn