Using Custom Fields in Salesforce B2B Commerce Cloud UI


Many times, there is a need to create custom fields on objects for storing project specific custom data. We can create custom fields on any Salesforce B2B Commerce Cloud (preiously CloudCraze) custom objects. However, the steps below need to be followed in order to expose those fields on CC model and to be used on UI level when pages are rendered on storefront.

 

Custom field for regular or header objects

Objects like Product, Cart, Order are header objects and we can use applicable service class to extend and pull in the custom fields to Salesforce B2B Commerce Cloud model.

CodeHeaderObject

Custom field for iterative objects

Object like Cart Items, Order Items etc. are used for showing information about all items in the cart or order. There is no direct service class for these objects. In order to add new custom fields, we have to extract the subquery and update that using header object service class.

Use ccLog query parameter to generate CC logs in the browser console. Extract the field subquery from there that will be used in the service class.

 

Below is an example of service class extension to use the extracted subquery and add other custom fields for CC model.

Cart service

Code2ChildObject

 

Using the service class extension

After creating the service class extension code, they need to be called and associated appropriately in CC Admin Service Management. The classes need to be set with “c.” prefix. This will allow Salesforce B2B Commerce Cloud to read these custom fields for further usage. These will appear in base CC data model for appropriate objects and can be read on the VF handlebar overrides.

CC Admin Service Management

 

View more blogs and tutorials about
Salesforce B2B Commerce Cloud

Learn more about our Salesforce B2B Commerce Cloud work

For thought leadership on B2B Commerce,
please click here for blogs and here for video

 

SEARCH ARTICLES

CATEGORIES

Sitecore 144
Commerce 100
Web Development 100
Sitecore Commerce 83
Sitecore Experience Commerce 9 64
Sitecore Experience Commerce 59
Content Management 55
eCommerce 48
B2B eCommerce 42
Sitecore Experience Platform 39
Sitecore Platinum Partner 39
Architecture 34
Insite 29
User Experience 26
Strategy 22
B2C eCommerce 21
B2B Commerce Blogs 21
commerceconnect 21
CloudCraze 20
SaaS (Software as a Service) 20
Cloud 17
Commerce Server 17
Salesforce B2B Commerce Cloud 16
Mobile 13
Search 13
Plugins 12
Analytics 12
Application Development 12
Digital Transformation 11
Sitecore Symposium 11
SPEAK 10
Helix 10
DMS 8
Social 8
Business Process 7
Authentication 7
5 Reasons 7
BI and Big Data 6
Data Visualization 6
Sitecore Presentation 6
Coveo 6
NET Development 5
Microsoft Azure 5
Automation 5
Front-End Development 4
SaaS (Software as a Service) 4
Digital Strategy 4
Brightcove 4
Press Release 4
Avalara Tax 3
Sitecore Experience Accelerator (SXA) 3
Sitecore Layouts 3
Video 3
SPE 3
Multi-site 3
Multi-lingual 3
Accessibility 3
Habitat 3
Vault 3
Identity 2
Managed Services 2
CDN 2
SMB 2
Cryptocurrency 2
Sitecore Forms 2
Sitecore Experience Commerce 9 Promotions 2
Uncategorized 2
EXM 2
Conversational Commerce 2
Sitecore SaaS 2
Security 2
Unit Testing 2
Headless Architecture 2
Sitecore Experience Awards 2
Google 1
Content Delivery Network 1
Configure Price Quote 1
CPQ 1
Blockchain 1
Coupons 1
Sitecore Rss 1
Artificial Intelligence 1
Machine Learning 1
Okta 1
RFP Process 1
NoSQL 1
Flex Accelerator for Sitecore 1
Reviews 1
SEO 1
Page Labels 1