Retrieve Child Items Using TMF620 API
Create custom metadata and update the Data Mapper Transform in Salesforce for the specific resource to retrieve child items from TMF620 Product Catalog Management API resources. By default, the API returns the parent-bundled items in the response.
- With these changes, the GET and POST APIs for all TMF 620 API resources return the child items in the responses.
- To retrieve child products information, set
Specification Sub Type = Bundle
for the product specifications or offerings created through Vlocity Product Designer or Console App.
- From Setup, in the Quick Find box, enter
Metadata
, and then click Custom Metadata Types. - Click Manage Records associated with Vlocity Integration Setting.
- Click New.
- Create the TMForumDefaultAttributeCategory custom metadata with these values:
- Label:
TMForumDefaultAttributeCategory
- Type of API:
TMForum
- API Name:
TMForumDefaultAttributeCategory
- Key:
AttributeCategoryName
- Default Value:
TMForum
- Vlocity Integration Setting Name:
TMForumDefaultAttributeCategory
- Label:
- Create the TMForumProductSpecificationUseChildForBu custom metadata for the productSpecification resource with these values:
- Label:
TMForumProductSpecificationUseChildForBu
- Type of API:
TMForum
- API Name:
TMForumProductSpecification
- Key:
UseChildForBundleProduct
- Default Value:
true
- Vlocity Integration Setting Name:
TMForumProductSpecificationUseChildForBu
- Label:
- Create the TMForumProductOfferingUseChildForBu custom metadata for the productOffering resource with these values:
- Label:
TMForumProductOfferingUseChildForBu
- Type of API:
TMForum
- API Name:
TMForumProductOffering
- Key:
UseChildForBundleProduct
- Default Value:
true
- Vlocity Integration Setting Name:
TMForumProductOfferingUseChildForBu
- Label:
- Create the TMForumAllFieldstoQuery custom metadata, which is required for both the productSpecification and productOffering resources, with these values:
- Label:
TMForumAllFieldstoQuery
- Type of API:
TMForum
- API Name:
TMForum
- Key:
AllFieldstoQuery
- Default Value:
true
- Vlocity Integration Setting Name:
TMForumAllFieldstoQuery
- Label:
- Update the TMFTMForumProductSpecificationResponseTransform Data Mapper Transform for the productSpecification resource.
- On the OmniStudio DataRaptors tab in the OmniStudio app, access the TMFTMForumProductSpecificationResponseTransform Data Mapper Transform.
- Modify the mapping for the bundledProductSpecification node to use the
ChildProductId__r
field for the Name and ID properties.- Change the input JSON path from
productChildItems:vlocity_cmt__ParentProductId__r:Name
toproductChildItems:vlocity_cmt__ChildProductId__r:Name
. - Change the input JSON path from
productChildItems:vlocity_cmt__ParentProductId__r:vlocity_cmt__GlobalKey__c
toproductChildItems:vlocity_cmt__ChildProductId__r:vlocity_cmt__GlobalKey__c
.
- Change the input JSON path from
- Modify the formula for
productChildItems:href
to use theChildProductId
field instead of theParentProductId
field.- Change the formula from
IF(productChildItems:Id != null, CONCAT(requestUrl,'productSpecification/',productChildItems:vlocity_cmt__ParentProductId__r:Id), null)
toIF(productChildItems:Id != null, CONCAT(requestUrl,'productSpecification/',productChildItems:vlocity_cmt__ChildProductId__r:Id), null)
.
- Change the formula from
- Update the TMFTMForumProductOfferingResult Data Mapper Transform for the productOffering resource.
- On the OmniStudio DataRaptors tab in the OmniStudio app, access the TMFTMForumProductOfferingResult Data Mapper Transform.
- Modify the mapping for the bundleProductOffering node to use the
ChildProductId__r
field for the Name and ID properties.- Change the input JSON path from
productChildItems:vlocity_cmt__ParentProductId__r:Name
toproductChildItems:vlocity_cmt__ChildProductId__r:Name
. - Change the input JSON path from
productChildItems:vlocity_cmt__ParentProductId__r:vlocity_cmt__GlobalKey__c
toproductChildItems:vlocity_cmt__ChildProductId__r:vlocity_cmt__GlobalKey__c
.
- Change the input JSON path from
- Modify the formula for
productChildItems:href
to use theChildProductId
field instead of theParentProductId
field.- Change the formula from
IF(productChildItems:Id != null, CONCAT(requestUrl,'productOffering/',productChildItems:vlocity_cmt__ParentProductId__r:Id), null)
toIF(productChildItems:Id != null, CONCAT(requestUrl,'productOffering/',productChildItems:vlocity_cmt__ChildProductId__r:Id), null)
.
- Change the formula from