We’ve implemented a custom Groovy validation script for contract records that should validate payment terms before save. The script was registered through Application Composer under the Contract object, but it’s not firing when users update the custom PaymentTerms__c field.
The script registration appears correct in the UI, and we’ve verified the custom field API name matches exactly. We’ve tried clearing browser cache and reloading the page, but the validation never triggers. The field updates save without any validation errors being thrown.
Has anyone experienced issues with Groovy script registration not taking effect immediately? Do we need to refresh some kind of metadata cache on the server side?
The root cause is likely a combination of deployment state and cache timing. Here’s the complete resolution process:
1. Groovy Script Registration Verification:
In Application Composer, navigate to Contract object > Server Scripts. Confirm your script shows:
Event Type: Before Update (or Before Insert if validating on create)
Status: Active
Object: Contract
Last Modified date reflects your recent changes
2. Custom Field API Name Validation:
The field reference must be exact. Go to Setup > Objects > Contract > Fields and verify:
// Correct field reference in your script:
def terms = newObject.PaymentTerms__c
// NOT: newObject.paymentterms__c (case matters)
// NOT: newObject.PaymentTerms (missing __c)
3. Metadata Cache Refresh (Critical Step):
Oracle CX Cloud caches metadata at multiple layers. After script registration:
Click ‘Publish Sandbox’ if in sandbox environment
For production: Application Composer > Actions > Publish Configuration
Wait 15-20 minutes for propagation across all nodes
Have users perform hard refresh (Ctrl+F5) to clear browser cache
Alternatively, contact Oracle Support to request manual metadata cache flush (faster but requires SR)
4. Role-Based Layout Assignment:
Even with correct script registration, ensure the custom field appears on the page layout assigned to test users’ roles. Scripts won’t fire for fields not visible on the layout. Check Setup > Page Layouts > Contract Layout > ensure PaymentTerms__c is present.
5. Validation:
After publishing and waiting, test by:
Creating new browser session (incognito mode)
Updating contract with invalid payment terms
Script should now throw validation error
Troubleshooting Tips:
Enable debug logging: Setup > Debug Logs > create log for your user
Check for script compilation errors in Application Composer
Verify no duplicate scripts registered for same event
Confirm field-level security grants read access to the custom field
The publish/cache refresh step is mandatory - scripts won’t execute until configuration is fully deployed across the cluster. This is by design to prevent inconsistent behavior during updates.
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.
Check your script trigger configuration. In Application Composer, go to the Contract object and verify that your Groovy script is bound to the correct event type. For field validation, you need ‘Before Insert’ or ‘Before Update’ events. Also confirm the script status shows as ‘Active’ in the script library.
I had similar issues with custom field validations. The API name is case-sensitive and must include the __c suffix. Double-check in Setup > Custom Fields that PaymentTerms__c is the exact API name. Also, verify your Groovy script references the field correctly using the same case and suffix. Sometimes copy-paste from documentation introduces hidden characters.
Tested this on Oracle CX Cloud 23D by verifying the Groovy script status showed Active in Application Composer’s Server Scripts and confirming exact custom field API names resolved our silent validation failures.
This happened to us last month. After registering new Groovy scripts in Application Composer, Oracle CX Cloud requires a metadata refresh cycle. The changes don’t always propagate immediately to all application server nodes. Try logging out completely, waiting 10-15 minutes, then log back in. If you have sandbox access, test there first to confirm the script logic works before troubleshooting deployment issues in production.
Thanks for the suggestions. I verified the event binding is set to ‘Before Update’ and the status shows Active. The API name is definitely correct with __c suffix. I’ll try the logout/wait approach, but is there a way to force the metadata refresh rather than waiting? Our users need this validation active today.
In addition to the metadata cache, check if your script has any compilation errors. Go to Application Composer > Scripts > your script name and look for any red error indicators. Even if the script shows Active, syntax errors can prevent execution. Also verify that the user role testing this has access to the custom field - field-level security can silently prevent script triggers if the field isn’t visible to that role.
Check your object deployment status. Sometimes custom scripts don’t activate until the entire object customization is published. In Application Composer, look for a ‘Publish’ or ‘Deploy’ button for the Contract object. Click that to push all pending changes including script registrations.
Also verify your Groovy script syntax for field references:
def paymentTerms = newObject.PaymentTerms__c
if (paymentTerms == null || paymentTerms.isEmpty()) {
throw new ValidationException("Payment terms required")
}
Make sure you’re using newObject not oldObject for Before Update triggers.