Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

CI:J realtime form phone field validation

(1) ShareShare
ReportReport
Posted on by 35
Hi guys
 
I am using a standard phone number field on a rtm form. I don't want to use the standard "phone number" validation. Every time I set the validation to custom or no validation, it resets after saving. According to this documentation, it should be able to use no validation as long as I don't use any phone consent on the form. Does anybody know if I'm doing something wrong?
 
The CI:J version is up to date.
 
Thanks and br
Lukas
  • Suggested answer
    Saif Ali Sabri Profile Picture
    Saif Ali Sabri 370 on at
    CI:J realtime form phone field validation
    AI was used to create this answer
    The issue you're facing in Dynamics 365 Customer Insights - Journeys (CI:J) with the phone number field validation resetting is likely tied to how the system enforces certain configurations when using real-time marketing (RTM) forms

    Understanding the Problem

    1. Default Phone Number Validation:

      • By default, RTM forms apply standard phone number validation to ensure data quality and formatting. This validation aligns with global phone number formats, including country codes.
      • When you change the validation to custom or none, the system sometimes resets it because:
        • Phone consent settings are enabled, requiring the phone number to pass standard validation.
        • The system enforces validation rules tied to phone consent compliance.
    2. Documentation Clarification:

      • As per the documentation, if phone consent is disabled on the form, you should be able to set the validation to "Custom" or "None." However, this functionality can be overridden if other settings are applied or the system enforces specific rules for phone fields.
    3. Potential Causes for Resetting:

      • Phone consent might still be implicitly enabled (even if not explicitly configured).
      • There may be a mismatch between your form configuration and what the real-time marketing engine expects.
      • The CI:J version may have a bug or limitation that prevents saving the custom validation for phone fields.

    Steps to Fix the Issue

    Step 1: Verify Phone Consent Settings

    1. Open your real-time marketing form in the form editor.

    2. Check the Form Field Settings for the phone field:

      • Go to the Properties pane of the phone number field.
      • Ensure that Phone consent is not enabled.
        • If phone consent is enabled, the system enforces strict validation to ensure compliance.
      • Save the form after disabling the phone consent.
    3. Test if disabling phone consent allows you to save the validation setting as Custom or None.


    Step 2: Manually Set Validation to Custom or None

    1. In the form editor, select the phone field.

    2. In the Field Properties:

      • Change the validation type to Custom or None.
      • Save the changes.
    3. Publish the form and verify:

      • Ensure that the field does not reset its validation type after saving.
      • If it resets again, proceed to the next step.

    Step 3: Configure a Custom Validation Rule

    If the system continues to override your validation settings, configure a custom JavaScript validation rule for the phone field.

    1. Add a JavaScript Validation Rule:

      • Use a custom script to validate the phone field at runtime.

      • Example:

         
        javascript
        function customPhoneValidation(context) {
        var phoneField = context.getFormContext().getAttribute("mobilephone");
        if (phoneField) {
        var phoneValue = phoneField.getValue();
        // Add your custom validation logic here
        if (phoneValue && phoneValue.length < 10) {
        phoneField.setNotification("Phone number must be at least 10 digits.");
        } else {
        phoneField.clearNotification();
        }
        }
        }
    2. Inject the Script:

      • Use the form's Custom JavaScript Section to add the above script and bind it to the phone field.
    3. Test the Form:

      • Preview the form and verify that your custom validation logic works as intended.

    Step 4: Use a Custom Field

    If the issue persists and you do not need the standard phone number field, consider creating a custom single-line text field to capture phone numbers:

    1. In the Dataverse table associated with the form, create a new text field for phone numbers (e.g., CustomPhone).
    2. Add this custom field to your RTM form.
    3. Since this field is not a standard "Phone" field, it won’t inherit the default phone validation rules, and you can configure any custom validation as needed.

    Step 5: Check CI:J Version and Known Issues

    1. Ensure your Customer Insights - Journeys environment is fully updated.

      • Microsoft frequently releases fixes and improvements for RTM forms.
    2. Check the release notes for your version to identify any bugs related to field validation or form settings:

    3. If the issue persists after verifying all configurations, report the issue to Microsoft Support as it may be a platform limitation or a bug in the version you're using.


    Best Practices

    1. Use Explicit Consent Management:
      • If phone consent is required in other parts of your marketing processes, ensure the phone consent toggle is appropriately configured at the form level.
    2. Always Test in Preview Mode:
      • Test form behavior in the preview mode to ensure validation logic works as expected.
    3. Document Customizations:
      • Keep track of any custom JavaScript or field configurations for future updates and troubleshooting.

    Summary

    • Ensure phone consent is disabled in the form field settings.
    • Set the phone field validation to Custom or None and verify that the changes persist.
    • If it still resets, implement custom JavaScript validation or use a custom text field for phone numbers.
    • Update your CI:J environment and check for known issues in the release notes.

      If none of these steps resolve the issue, it’s likely a system bug or limitation.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans