Here’s a comprehensive solution covering all aspects of your formula trigger issue:
1. Formula Trigger Configuration:
First, properly configure your formula triggers in Application Composer:
- Navigate to Lead object → LeadScore field → Formula Properties
- Change trigger type from ‘Always’ to ‘When Dependent Fields Change’
- In the Recalculation Triggers section, explicitly add:
- EmailEngagementScore
- WebsiteActivityCount
- DemoRequested
This ensures the formula recalculates whenever any of these three fields are modified.
2. Dependent Field Mapping:
Verify your field mapping configuration:
// In Application Composer, edit your formula and add explicit dependencies:
formula: {
expression: "(EmailEngagementScore * 0.3) + (WebsiteActivityCount * 0.4) + (DemoRequested ? 30 : 0)"
dependsOn: ["EmailEngagementScore", "WebsiteActivityCount", "DemoRequested"]
recalculateOn: "DEPENDENT_FIELD_UPDATE"
}
The key is setting recalculateOn to trigger on dependent field updates, not just direct LeadScore modifications.
3. Create vs Update Lifecycle Behavior:
Understand the different behaviors:
- Create lifecycle: All formulas execute automatically, regardless of trigger configuration
- Update lifecycle: Only formulas with explicit triggers execute
- API updates: By default, skip formula execution unless explicitly requested
For your REST API integration, modify your update requests:
// Add query parameter to force formula execution
PATCH /crmRestApi/resources/11.13.18.05/leads/{id}?onlyData=false
The onlyData=false parameter instructs CX Cloud to execute all business logic including formulas, validations, and triggers during the update.
Alternatively, use the header approach:
Headers: {
"X-Recalculate-Formulas": "true"
}
4. Scheduled Recalculation Implementation:
As a backup mechanism and for data consistency, implement scheduled recalculation:
Create a scheduled process in Application Composer:
- Go to Application Composer → Scheduled Processes → Create New
- Name: “Recalculate Lead Scores”
- Frequency: Every 4 hours (or based on your SLA requirements)
- Groovy script:
def leads = adf.util.query("Lead", "ModifiedDate >= SYSDATE-1/6")
leads.each { lead ->
lead.recalculateFormulas(["LeadScore"])
}
This ensures any missed calculations are corrected within your defined window.
Additional Best Practices:
Testing the Configuration:
- Test direct UI update: Manually update EmailEngagementScore in UI and verify LeadScore recalculates
- Test API update: Update via REST API with
onlyData=false and verify formula execution
- Test scheduled job: Run the scheduled process manually and check recalculation logs
Performance Considerations:
- Real-time formula execution adds latency to API updates (typically 200-500ms)
- For high-volume integrations, consider batching updates and using scheduled recalculation
- Monitor formula execution time in diagnostic logs
Troubleshooting:
If formulas still don’t trigger after configuration:
- Check Application Composer logs for formula execution errors
- Verify field data types match formula expectations (nulls can cause silent failures)
- Ensure your API user has permissions to execute formulas
- Test with a simple formula first (e.g.,
return 100) to isolate logic issues from trigger issues
Migration Note:
If you’re upgrading from an earlier version of CX Cloud, formula trigger behavior changed in 23C. Review all existing formulas and explicitly configure dependencies that were previously implicit.
With these configurations in place, your lead scoring formula will reliably recalculate on both create and update operations, whether initiated through the UI, API, or scheduled jobs.
This draft is based on general Oracle CX Cloud knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.