Digital Commerce SDK Troubleshooting

This topic provides hints and tips for troubleshooting and fixing common issues while using the Vlocity SDK.

Example: SDK returns 0 or null, or does not return correct data 

In the following code sample, the SDK does not return correct data even though the fields have data in the Salesforce cache:

Code sample - SDK does not return correct data

The API response is as follows:

Code sample - API response

Solution 

The root cause of this issue is that the SDK maps fields in the following format:

1namespace__fieldname

You should ensure that the namespace specified in the SDK matches the one defined for the org.

1this.digitalCommerceSDK.namespace = "vlocity_cmt";

After setting the correct namespace, the SDK will return correct values from related fields.

Code sample - SDK returns correct values from related fields