Record not created after submission

Loading

When users submit a form through Power Pages (or any Dataverse-based application like Power Apps or Dynamics 365), but the record is not created as expected, it can be due to several reasons related to configuration, security, data validation, or custom scripts.

Here’s a detailed guide to troubleshooting and resolving the issue of “Record Not Created After Submission.”


1. Check Form Configuration and Data Binding

The first thing to verify is the form configuration and data binding to ensure that the form is correctly set up to create a record upon submission.

Steps to verify:

  1. Form Configuration:
    • In Power Pages, ensure that the form is set to submit the data to the correct entity or table in Dataverse. You can check this by reviewing the form properties in the portal settings.
    • Make sure the form is linked to the correct data source (i.e., the correct entity in Dataverse).
  2. Field Mappings:
    • Verify that the form fields are correctly mapped to the corresponding fields in the target entity. If a form field is not correctly mapped or the field is missing, the record may not be created properly.
    • Ensure that any mandatory fields are included in the form and mapped correctly.

2. Check for Required Fields and Validation Errors

If the form submission is not creating a record, there might be validation errors related to required fields or incorrect data entered in the form.

Steps to verify:

  1. Check Required Fields:
    • Review the entity schema in Dataverse and check for any required fields. If any of the required fields are not filled in the form, the record will not be created. Ensure that all required fields are present in the form and correctly validated.
  2. Check for Data Validation:
    • Ensure that the data entered in the form complies with the validation rules of the fields in the entity. For example, if a field expects a date and the user enters text, it could prevent the record from being created.
    • Use the developer console or browser tools to check if there are any JavaScript validation errors.
  3. Check for Custom Validation:
    • If there are custom validation rules on the form or entity (using business rules or JavaScript), make sure they are not blocking the creation of the record due to failed validation.

3. Check for Custom Business Logic (JavaScript, Workflows)

If you have custom logic such as JavaScript, workflows, or business rules, they could be interfering with the record creation process.

Steps to verify:

  1. Check JavaScript:
    • If you are using custom JavaScript to handle form submissions or perform actions on the form, ensure that the script is functioning correctly. You can inspect any custom script in the browser’s developer console for errors.
    Example of a basic form submission in JavaScript:
    function submitForm() { // Custom validation or logic Xrm.Page.data.entity.save(); } If this script has errors, it could prevent the record from being saved.
  2. Check Workflows:
    • If there are workflows or Power Automate flows triggered on record creation, verify that they are not failing or preventing the record from being created. Review the workflow steps to see if there are conditions that may be blocking the record creation.
    • Look for any errors in the workflow history that might indicate why the workflow failed, preventing the record from being created.
  3. Business Rules:
    • Review any business rules applied to the form or entity. If a business rule is incorrectly configured, it could prevent the record from being created by enforcing conditions that are not met.

4. Check for Permissions Issues

Sometimes, permissions issues may be the cause of records not being created after form submission, especially when using Dataverse or Power Pages.

Steps to verify:

  1. Check Entity Permissions:
    • Ensure that the user who is submitting the form has Create permissions on the target entity. If the user does not have permission to create records, the form will not be able to save the data.
    • Review the Security Roles and permissions assigned to the user or the Portal User.
  2. Review Role-Based Access Control (RBAC):
    • If the portal is using role-based access control (RBAC), ensure that the user has the correct Web Role to submit the form. If the Web Role does not grant create permissions on the form’s entity, the record will not be created.
    • Review Entity Permissions in the Portal Management app to verify whether the user has access to create records.
  3. Check for Access Team Permissions:
    • If the record is being saved to a related entity, ensure that the user has proper permissions to create records on the related entity as well.

5. Examine Submission Events and Custom Buttons

If you have customized the form’s submit button or event handlers, ensure that the submission event is correctly firing, and that no issues are preventing the record creation.

Steps to verify:

  1. Check Submit Button:
    • Ensure that the submit button is correctly wired up to the submission action. In some cases, the button may not be triggering the save event or may be overriding it with custom logic.
  2. Review Custom Submit Logic:
    • If the form submission is handled by custom logic, ensure that the logic is correctly set up to handle the data and trigger the record creation. Use browser developer tools to verify that the correct API or function is called when the form is submitted.

6. Check for Portal Caching Issues

In some cases, portal caching issues can prevent the newly created record from showing up immediately or prevent the form from functioning properly.

Steps to verify:

  1. Clear Cache:
    • Clear the portal cache to ensure that any old data or settings are not causing issues with record creation.
  2. Test in Incognito Mode:
    • Try submitting the form in an incognito or private browsing mode to ensure that the issue is not related to cached data or session problems.

7. Verify Data Source and Connectivity

Ensure that the form is connected to the correct data source (e.g., the appropriate Dataverse environment) and that there are no issues with connectivity that might be preventing record creation.

Steps to verify:

  1. Check Data Source Configuration:
    • Verify that the form is correctly connected to the appropriate Dataverse environment and that the form is configured to submit the data to the right table or entity.
  2. Network Issues:
    • Confirm that there are no network connectivity issues that might be preventing data from being saved or transmitted to Dataverse.

8. Review Entity Logs

If you have logging enabled for your Dataverse entities or Power Pages portal, check the entity logs to see if any errors or issues are logged when the form is submitted. These logs can provide insights into why the record is not being created.

Steps to verify:

  1. Check Entity Logs:
    • Navigate to the Audit History or Logs in the Power Pages or Dataverse admin center to check if any errors are recorded when submitting the form.
  2. Look for Error Codes:
    • If there are errors in the log, look for specific error codes or messages that could give you a clearer idea of why the record was not created.

Leave a Reply

Your email address will not be published. Required fields are marked *