Symptom
Tax-related attributes (e.g., Listed Unit Price with Tax, Tax Amount Recurring, Price Per Unit With Tax) are not populated on deliverables and invoices for certain order types (e.g., Cash Pay Orders placed by Customer Service Agents).
When the Product Configuration is manually edited and saved, the tax values populate correctly. However, during automated rule execution (e.g., when an order is initially created), the tax fields remain blank.
The following SOQL query can help diagnose the issue:
SELECT Id, CreatedDate,
CS_Shipment_Schedule__r.CS_Order_Id__c,
CS_Tax_Amount__c,
CS_Total_Tax_Amount__c,
CS_Shipment_Schedule__r.CS_Quantity__c,
CS_Shipment_Schedule__r.CS_Deliverable__r.CS_Tax_Amount_Recurring__c,
CS_Shipment_Schedule__r.CS_Deliverable__r.CS_Price_Per_Unit_With_Tax__c,
CS_Shipment_Schedule__r.CS_Deliverable__r.CS_Tax_Before_Discount__c,
CS_Shipment_Schedule__r.CS_Deliverable__r.Name
FROM CS_Invoice__c
WHERE CS_Shipment_Schedule__r.CS_Deliverable__r.CS_Order_Type__c = 'Cash Pay'
AND CreatedDate = TODAY
ORDER BY CreatedDate DESC
Cause
The issue is caused by an incorrect sequence of actions within a configurator rule. The action that depends on the Tax Percent attribute is being executed before the action that sets the Listed Unit Price Tax Amount attribute.
Since the dependent value has not been calculated yet at the time the tax action runs, the tax fields remain null/blank.
Resolution
Step 1: Identify the affected rule
Navigate to the CloudSense Configurator rules for the affected Product Definition. Identify the rule responsible for calculating tax-related attributes (e.g., Rule 339 or the equivalent in your configuration).
Step 2: Review the action sequence
Open the rule and examine the order of actions. Look for:
- An action that sets the Listed Unit Price Tax Amount or Tax Percent attribute
- An action that reads or depends on the Tax Percent to calculate other values (e.g., Price Per Unit With Tax, Tax Amount Recurring)
Verify whether the dependent action appears before the source action in the execution order.
Step 3: Correct the action sequence
Reorder the actions so that:
1. The action setting the base tax attribute (e.g., Listed Unit Price Tax Amount) executes first
2. The action(s) that depend on the tax value execute after
Save the rule changes.
Step 4: Recompile the Product Definition
After modifying the rule, recompile the Product Definition using the "Compile Online Rules & UI" button to ensure the updated rule sequence takes effect.
Step 5: Verify the fix
Create a new test order of the affected type and confirm that:
- Tax attributes are correctly populated on the Product Configuration
- Deliverables show the expected tax values
- Invoices reflect the correct tax amounts
Why This Happens
Configurator rules are defined as cscfga__Configuration_Rule__c records with child cscfga__Rule_Action__c records. The execution order is determined by the cscfga__Sequence__c field on each Rule Action -- when actions have interdependencies (e.g., Tax Percent must be calculated before Price Per Unit With Tax), the sequence numbers must reflect this ordering.
Key distinction: During automated rule execution, each action runs exactly once in sequence order. Manual edits in the UI trigger a full recalculation cycle, which is why editing and saving the configuration appears to "fix" the values even when the action sequence is wrong. This explains the symptom where values populate correctly on manual save but not during initial automated processing.
After correcting the action sequence, the "Compile Online Rules & UI" button regenerates the compiled rule artifacts so the Configurator Service picks up the corrected ordering.
Additional Notes
- This issue is a common pattern whenever configurator rule actions have interdependencies. Always verify that source attributes are calculated before dependent attributes in the action sequence.
- The issue typically manifests only during automated/initial rule execution. Manual edits trigger a full recalculation cycle, which is why editing and saving the configuration appears to "fix" the values.
- Use the SOQL query in the Symptom section to quickly audit tax values across recent orders and identify which order types are affected.
Priyanka Bhotika
Comments