Problem
When attempting to update Order Enrichment (OE) attributes in the Solution Console, you may find that the UI does not allow edits due to the current basket stage. This typically occurs when:
- The basket has progressed to stages like Submitted, Cancelled, or other stages that lock Order Enrichment modifications
- You need to correct an attribute value (e.g., change
falsetonull, update a date, fix a typo) to resolve downstream integration errors - The attribute value is causing OSS submission failures or other API errors
The UI may not display an error message, but the attribute fields are disabled or grayed out, preventing manual updates.
Root Cause
CloudSense enforces basket stage restrictions to maintain data integrity and prevent unintended modifications during specific workflow phases. By default, StarHub and other implementations configure Custom Settings to restrict Order Enrichment modifications in certain stages.
Common stage restrictions:
- Submitted: Order Enrichments are locked to prevent changes after submission
- Cancelled: Order Enrichments are locked as the basket is no longer active
- Other stages may be configured based on business requirements
When a basket is in a restricted stage, the UI disables Order Enrichment attribute fields, and any attempt to update them via the UI will fail silently.
Resolution Steps
Step 1: Verify the Current Basket Stage
- Open the basket in the Solution Console
- Check the basket stage indicator at the top of the page
- Note the current stage (e.g., Submitted, Order Enrichment, Solution Creation, etc.)
Step 2: Identify the Configuration and Order Enrichment GUIDs
To update an Order Enrichment attribute via script, you need three pieces of information:
- Configuration GUID: The GUID of the configuration containing the Order Enrichment
- Order Enrichment Configuration GUID: The GUID of the specific Order Enrichment record
- Attribute Name: The exact name of the attribute you want to update
Option A: Use the Browser Console to Retrieve GUIDs
- Open the basket in the Solution Console
- Open the browser console (F12 or right-click > Inspect > Console tab)
- Run the following script to list all configurations and their Order Enrichments:
await CS.SM.getActiveSolution().then(solution => {
const configs = solution.getConfigurations();
configs.forEach(config => {
console.log(`Configuration: ${config.name} (${config.guid})`);
const oes = config.getOrderEnrichmentConfigurations();
if (oes && oes.length > 0) {
oes.forEach(oe => {
console.log(` Order Enrichment: ${oe.name} (${oe.guid})`);
const attrs = oe.getAttributes();
Object.keys(attrs).forEach(attrName => {
console.log(` Attribute: ${attrName} = ${attrs[attrName].value}`);
});
});
}
});
});
- Note the Configuration GUID, Order Enrichment GUID, and Attribute Name from the console output
Option B: Retrieve GUIDs from the ServiceSpecification.json File
- Navigate to Setup > Static Resources in Salesforce
- Search for your ServiceSpecification static resource (e.g., "ServiceSpecification_StarHub")
- Download and open the JSON file
- Search for the configuration and Order Enrichment by name
- Note the GUIDs from the JSON structure
Step 3: Update the Attribute Using the CS.SM API
Once you have the GUIDs and attribute name, use the following script to update the Order Enrichment attribute:
let solution = await CS.SM.getActiveSolution();
await solution.updateOrderEnrichmentConfigurationAttribute(
"0a7a5985-d9d9-5bff-1470-64c5cce9a193", // configurationGuid
"c7e70770-df57-4b31-82ed-1e3bf8942401", // orderEnrichmentConfigurationGuid
[{
name: "seasonalTimeSlot",
value: null, // Set to null, or provide the new value
displayValue: null // Set to null, or provide the new display value
}]
).then(updatedConfig => {
console.log("Attribute updated successfully:", updatedConfig);
}).catch(error => {
console.error("Failed to update attribute:", error);
});
Important notes:
- Replace the GUIDs with the actual values from your basket
- Replace "seasonalTimeSlot" with the actual attribute name you want to update
- Set value and displayValue to the desired new values (use null to clear the attribute)
- For some browsers, you may need to set the console context to VfRemoteId (see dropdown in the console toolbar)
Step 4: Verify the Update
- Check the console output to confirm the update succeeded
- Refresh the Solution Console or re-open the Order Enrichment view
- Verify the attribute value has been updated correctly
Step 5: Retry Downstream Operations
- If the attribute update was needed to fix an integration error, retry the operation:
- For OSS submission errors: Resubmit the order to OSS
- For API errors: Retry the API call
-
For validation errors: Revalidate the basket
-
Monitor the operation to confirm it completes successfully without the previous error
Alternative: Change Basket Stage (If Applicable)
If your business process allows changing the basket stage temporarily:
- Change the basket stage to a stage that allows Order Enrichment edits (e.g., "Order Enrichment")
- Update the attribute via the UI
- Change the basket stage back to the original stage (e.g., "Submitted")
Important notes:
- Changing the basket stage may trigger other business rules or validations
- Reverting the stage from Submitted back to Order Enrichment and then to Submitted again may retrigger downstream processes (e.g., Order/Subscription/Service bundle creation)
- Consult your internal team before using this approach to avoid unintended side effects
Verification
After updating the attribute:
- Query the Order Enrichment record in Salesforce to confirm the attribute value:
SELECT Id, Name, csord__Attribute_Values__c
FROM csord__Order_Enrichment_Configuration__c
WHERE Id = 'a0rXXXXXXXXXXXX'
-
Check the
csord__Attribute_Values__cfield (JSON format) to verify the attribute value is correct -
Test the downstream integration to ensure the corrected value resolves the original error
Prevention
To prevent this issue in future workflows:
- Validate attribute values before progressing the basket to restricted stages
- Implement validation rules to ensure Order Enrichment attributes are correctly populated before submission
- Document stage restrictions for your team to understand when OE edits are allowed
- Test attribute updates in sandbox environments before applying to production baskets
- Use the CS.SM API for bulk attribute corrections when multiple baskets are affected
Important Notes
- The
updateOrderEnrichmentConfigurationAttributeAPI works regardless of basket stage restrictions - Always verify the GUIDs before running the script to avoid updating the wrong configuration
- If you have multiple Order Enrichments in a configuration, ensure you target the correct one
- The script can update multiple attributes at once by passing an array of attribute objects
- Changes made via the API are persisted immediately and do not require a separate save operation
- If the attribute is part of a validation rule or trigger, ensure the new value satisfies those requirements
- For browsers that use iframes (e.g., Salesforce Classic), ensure the console context is set to VfRemoteId before running the script
Priyanka Bhotika
Comments