Our field sales team uses the SAP CX Mobile Sales app in offline mode during customer visits. When they create leads while offline and later sync, about 30% of the lead records fail to upload to the server. The app shows a generic “Sync failed” error without details about which validation failed.
Looking at the sync logs, I see errors like:
{"error":"ValidationError","field":"leadSource","message":"Required field missing"}
{"error":"ValidationError","field":"estimatedRevenue","message":"Invalid format"}
The offline data validation seems too lenient - it allows lead creation without required fields that the server rejects. Our mobile app field requirements don’t match the server-side validation rules, and the sync error handling doesn’t give users clear guidance on what to fix. How can we ensure offline leads meet all requirements before sync attempts?
The mobile app’s offline validation is intentionally relaxed to allow users to work without connectivity constraints. However, you can configure stricter client-side validation in the mobile app settings. Check the field configuration for Lead object in Mobile App Designer and mark critical fields as required with proper validation rules.
In SAP CX Admin Center, go to Mobile App Designer > Object Configuration > Lead. You’ll see all fields available in the mobile app. For each field, you can set validation rules including required status, data type validation, format patterns (regex), and min/max values. For estimatedRevenue, set the data type to Decimal and add a regex pattern to enforce numeric format. Also enable the “Validate on save” option so users get immediate feedback before the record is queued for sync.
It’s custom but straightforward. You create a pre-sync validation service that checks offline records against server-side validation rules before the actual sync. The service returns validation results, and the app displays a summary showing which records will sync successfully and which have errors. Users can then fix errors before syncing.
Beyond client-side validation, you should improve sync error handling. The mobile app can store detailed error messages for failed syncs, but you need to enable verbose error logging in the mobile configuration. This will show users exactly which field failed validation and why, allowing them to correct the data and retry the sync. We also implemented a sync preview feature that validates records before attempting upload.
I didn’t know we could configure validation in Mobile App Designer. Where exactly do I find the field configuration for the Lead object? And can I add custom validation rules for fields like estimatedRevenue to ensure numeric format?