Compliance Rules Missing From Dynamics 365 Forms With Eight Weeks to Audit
A decision guide for enforcing a rule an auditor will test: why form logic is not a control, business rule vs real-time workflow vs plug-in, the eight-week plan and the evidence pack.
Enforce the requirement on the server, not in the form. Form business rules, form scripts and a column's business required level act in the user interface, so a record created through the Web API, an import, an integration or a flow can skip them, and an auditor will test exactly that. A synchronous plug-in on create and update that throws an error blocks every channel. In eight weeks: inventory the rules the auditor will test, enforce them server-side first, clean or flag existing records, then tidy the supported out-of-the-box forms, and defer PCF or custom UI until after the audit. The evidence pack shows what was enforced, from when, how it was tested and the audit history proving it.
Why does a rule enforced only on the form fail an audit?
Because the form is one of several ways a record reaches Dataverse, and the auditor knows it. Users create records in the model-driven form, but records also arrive through the Web API and SDK, Excel and data imports, dataflows, Power Automate flows, integrations, other apps built on the same tables, and bulk edits. Logic attached to the form only runs when the form is used.
So a control that says "a case cannot be created without a linked customer contract" is not a control if it exists only as a form business rule or a required field on the form. A tester creates the record through the API or an import file, it saves, and the finding writes itself. The question to answer before the audit is not whether the form behaves, but whether the rule holds for every write channel, and whether you can prove from what date it did. This page is technical guidance for that question, not legal or regulatory advice; what the rule must be comes from your compliance function.
Which Dataverse mechanisms enforce a rule on every write channel?
The mechanisms differ in where they run, not in how they look to a user on the form. Microsoft revises some of this behaviour, so confirm the details against current documentation and, more importantly, prove each control with a test through the API before you rely on it.
| Mechanism | Where it runs | Blocks API, import and integration writes? |
|---|---|---|
| Business rule scoped to a form or all forms | In the browser, on the form | No. It only acts when the form is used. |
| Business rule scoped to the table (Entity) | On forms and on the server for create and update | Partly. Set value and some validation run server-side, but actions such as show, hide, lock and set requirement level are form-only. Test the exact rule through the API before relying on it. |
| Form script (JavaScript) and PCF control validation | In the browser, on the form | No. |
| Column requirement level: business required | On the form | No. The platform does not reject an API or integration write that omits a business required column; import tools vary, so test yours. |
| Real-time (synchronous) classic workflow | On the server, inside the transaction | Yes, with limits. A Stop workflow step with status Canceled raises an error and rolls the operation back. See the next sections. |
| Synchronous plug-in on PreValidation or PreOperation | On the server, before the core operation | Yes. Throwing InvalidPluginExecutionException rejects the write for every channel and returns your message to the caller. |
| Power Automate cloud flow triggered on create or update | Asynchronously, after the transaction has committed | No. It can flag or correct a record afterwards, but it cannot stop the save. |
How do you prevent a Dataverse record being created without a required lookup?
This is a frequent version of the problem: a record must always be linked to a parent, such as a case to a contract or an application to a customer. Here is how the three usual options compare for that specific rule.
| Criterion | Business rule | Real-time workflow | Synchronous plug-in |
|---|---|---|---|
| Stops a form save without the lookup | Yes, when the rule sets the lookup as required or shows an error on the form. | Yes, by stopping as Canceled with a message. | Yes, with the plug-in error shown to the user. |
| Stops an API, import or integration create | Not reliably. Form-scoped rules do nothing; a table-scoped rule must be proven by test. | Yes. The create is rolled back and the caller receives the error. | Yes. The write is rejected before the core operation. |
| Stops the lookup being cleared later on update | Only on the form. | Yes, if the workflow also runs on change of that column and checks it. | Yes, if registered on Update with the column in its filtering attributes and the check handles a null value. |
| Runs before the record is written | Not applicable | No. On create a real-time workflow runs after the core operation, inside the transaction, and the cancel rolls it back. | Yes, on PreValidation or PreOperation. |
| Needs a developer | No | No | Yes, C# built, tested and registered through a solution. |
| Microsoft direction for new work | Supported for form logic | Classic workflows remain supported, but Microsoft recommends plug-ins or Power Automate for new automation. | The recommended place for synchronous server-side validation. |
| Testability and evidence | Hard to prove across channels | Testable through the API, but harder to unit test and version than code | Unit tests, plug-in trace log, step registration and solution version as evidence. |
- On Create, check that the lookup column is present in the Target and is not null. On Update, only act when the Target contains the column, and reject a null value; there is no need to retrieve the record unless the rule depends on other columns.
- PreValidation runs before most platform checks and, for a top-level call, outside the database transaction, so it rejects early. PreOperation runs inside the transaction. Either works for a simple required-lookup check; use PreOperation where the check depends on values set by other logic earlier in the pipeline.
- Test the bulk path as well. Imports and integrations may use CreateMultiple, UpdateMultiple or ExecuteMultiple, so prove the plug-in fires and rejects in those cases in your environment, and check current Microsoft guidance on registering for the bulk messages.
- Write an error message a user and an integration developer can both act on, naming the rule and the missing column.
- Callers holding the privilege to bypass custom business logic can skip synchronous plug-ins and real-time workflows by request parameter. Review who holds it, including service accounts, and include that review in the evidence.
Can a real-time workflow stop a record being created?
It can make the create fail, which is often what people mean, but it is worth being precise because the difference matters to an auditor and to a developer. For the Create event a real-time workflow can only run after the core operation, not before it. The record has been written inside the database transaction when the workflow runs. If the workflow reaches a Stop workflow step with status Canceled, the platform raises an error with your message and the whole transaction is rolled back, so no record remains and the caller, whether a user on the form or an integration using the API, receives the error. For Update and Delete a real-time workflow can also be set to run before the operation.
That makes a real-time workflow a workable no-code option when there is no developer available and the rule is simple. The limits are real, though: conditions are harder to express and unit test than code, behaviour in bulk and nested operations needs testing, it is a classic workflow when Microsoft recommends plug-ins and Power Automate for new work, and it is more logic in a place future teams must remember to maintain. Where a developer is available, a plug-in is the control we would put in front of an auditor. When no-code configuration stops being enough in general is covered in when to hire a Dynamics 365 consultant or do it yourself.
Which rules will the auditor actually test?
Start the eight weeks with an inventory, not with code. Take the control descriptions, policies and last findings from your compliance team and turn each one into a rule statement against specific tables and columns, then find where, if anywhere, it is enforced today. Most teams discover some rules are enforced only on one form, some only in a flow that runs after save, some in a script that was copied to one form but not another, and some nowhere.
- The rule in one sentence, and the control or policy it comes from.
- Tables, columns and messages it affects: create, update, status change, assign, delete.
- Every write channel that touches those tables: forms, apps, imports, integrations, flows and service accounts.
- Where it is enforced today, and whether that enforcement is UI only, asynchronous or server-side.
- The count of existing records that break it, from a saved view or query.
- The evidence the auditor will expect to see for it, agreed with compliance now rather than in week seven.
What does the eight-week plan look like?
The order matters more than the exact weeks. Server-side enforcement goes first because it is the control; everything visible on the form is guidance layered on top. Customisation that could destabilise the environment before the audit waits.
| Weeks | Work | Output |
|---|---|---|
| 1 | Rule inventory with compliance, write-channel map, count of non-compliant records, agreement on the evidence the auditor expects. Switch on Dataverse auditing for the affected tables and columns now if it is not already, because it is not retroactive. | Signed rule list and evidence plan. |
| 2 to 4 | Server-side enforcement: synchronous plug-ins, one per rule or per table, with unit tests, deployed through a managed solution. Integration owners warned before go-live so their failures are expected and handled. | Rules enforced in production from a recorded date and solution version. |
| 3 to 5 | Existing records: report, fix what can be fixed with owner approval, and flag the rest with a documented exception. | Clean data or a controlled, dated exception list. |
| 5 to 6 | Supported out-of-the-box form work: required levels, business rules and form layout aligned with the server rules, so users see the requirement before the plug-in rejects the save. | Forms that guide users to the compliant path. |
| 7 | Channel tests: create and update attempts through the form, Web API, import file and each integration, recorded with results. | Test evidence per rule and channel. |
| 8 | Evidence pack assembled and walked through with compliance as a dry run of the audit. | Evidence pack and open-items list. |
| After the audit | PCF controls, custom pages and user experience improvements. | Better usability without audit-period risk. |
What should happen to existing records that already break the rule?
Enforcing a rule from today does not make yesterday's records compliant, and an auditor sampling historic records will find them. Decide for each rule, with compliance, what happens to the backlog, and record the decision.
- Report: a saved view or query listing every non-compliant record, with its count on the day enforcement went live.
- Fix: where the missing value can be established from a reliable source, correct the records through a controlled, logged update so the audit history shows who changed them and when. Watch the new plug-in: an update that does not supply the missing lookup will now be rejected, so fix records by setting the value, not by touching unrelated columns.
- Flag: where the value cannot be established, mark the record with a documented exception, a reason and an owner, and exclude it from processes that depend on the rule.
- Never bulk-fill a placeholder parent to make the count go to zero. It hides the gap and creates a worse finding.
- If duplicates are part of the problem, the matching and merge approach is covered in Dynamics 365 duplicate data cleanup.
Why should PCF controls and custom UI wait until after the audit?
Because they do not add control, and they add change. A PCF control or custom page can make the compliant path easier to follow, but it runs in the browser like any other form logic, so it cannot be the enforcement. Built under deadline pressure, it also brings new failure modes into production weeks before an audit: behaviour that differs between the test harness and a real form, performance issues and release-wave surprises, covered in why PCF controls fail in production.
Put the requirement on the server, use the supported out-of-the-box form features to guide users, and schedule the richer interface for after the audit, when it can be designed and tested properly through our PCF controls development work.
What goes into the audit evidence pack?
The pack answers four questions for every rule: what is enforced, from when, how you know it works, and what happened to records that predate it. Audit history retention and exporting who-changed-what evidence from Dataverse are covered in Dynamics 365 audit trails and compliance.
- The rule list: each rule, its source control or policy, the tables and messages it covers.
- How it is enforced: plug-in assembly and step registration (message, table, stage, mode, filtering attributes), exported from the environment, and the managed solution name and version that deployed it.
- From when: the deployment record from your pipeline or release log with date and approver. Solutions moved by hand make this hard to prove, which is one reason to move to Power Platform ALM with PAC CLI and pipelines.
- Test evidence: attempted creates and updates through the form, Web API, import and each integration, showing rejection with the error message, dated and repeatable.
- Dataverse audit history for the affected tables, showing records and changes since enforcement, and the plug-in trace log settings used during testing.
- The existing-record report on the enforcement date, the fixes applied and the exception list with owners.
- Who holds the privilege to bypass custom logic, and why.
Is Dynamics 365 still the right platform for these controls?
Usually yes. Dataverse gives you a transactional plug-in pipeline, auditing and a security model that can carry these controls well once they are in the right layer. A compliance gap found on the form is a design problem, not evidence that the platform is wrong. If the gap turns out to be one symptom of a wider pattern, such as heavy customisation, fragile plug-ins and no ALM, an independent Dynamics 365 health check and technical audit is the right next step, and the common design errors are catalogued in Dynamics 365 customization mistakes and how to fix them.
We recommend the right solution - whether that's Microsoft Dynamics 365, Power Platform, or a custom-built CRM. Some businesses need the Microsoft ecosystem. Others need full control without licensing. We deliver both. Where the controls you need, the hosting you must evidence or the licensing model do not fit Microsoft's platform, a custom-built CRM on React, Node.js, PostgreSQL or .NET is the alternative. If the audit needs a whole process built rather than one rule enforced, see building a CRM in 60 days for an audit.
Should audited business controls live in Dynamics 365 or in a CRM you build and host yourself?
Can afford licensing and want the Microsoft ecosystem
Dynamics 365
Microsoft 365, Teams and Outlook integration, a mature partner ecosystem, Copilot, and apps for sales, service and field operations that are configured rather than built.
Need full control and zero licensing
Custom CRM
A CRM built on React, Node.js, PostgreSQL or .NET that you own outright: your data model, your hosting, no per-user subscription, and features shaped exactly to your process.
Not sure which fits
We help you decide
A short discovery weighs licensing budget, process complexity, integrations and long-term ownership, then recommends one path. We deliver both, so the recommendation has no reason to lean.
How does Solzet help close a compliance gap before an audit?
We work in the order of this page: the rule inventory with your compliance team, server-side enforcement in plug-ins deployed through managed solutions, the existing-record report and remediation, form alignment, channel testing and the evidence pack, with PCF and interface work scheduled after the audit. Plug-in and Dataverse delivery is part of our Dynamics 365 development service.
Solzet delivers remotely from Yerevan, Armenia, with senior consultants and full-stack developers and 8+ years of Dynamics 365 Customer Engagement and Power Platform work, directly or white-label for Microsoft partners.
What do people ask us?
Does a business required field stop records being created through the API?
No. The business required level on a Dataverse column is enforced by the form, not by the platform, so a Web API, SDK or integration write that omits the column still succeeds, and import tools vary. To make a column genuinely mandatory for every channel, add a synchronous plug-in on create and update that rejects the write when the value is missing.
Do Dynamics 365 business rules run on the server?
Only when the business rule scope is set to the table (Entity). Rules scoped to a form or all forms run in the browser only. Table-scoped rules also run on the server for create and update, but actions such as showing, hiding, locking and setting requirement levels are form-only. Prove a server-side business rule with an API test before relying on it as a compliance control.
Can a real-time workflow cancel a record creation in Dataverse?
It can make the create fail. On Create, a real-time workflow runs after the core operation inside the transaction. A Stop workflow step with status Canceled raises an error and rolls the transaction back, so the record is not kept and the caller receives the error, including API callers. It cannot run before a create, and Microsoft recommends plug-ins or Power Automate for new automation.
What is the most reliable way to block a Dataverse record without a required lookup?
A synchronous plug-in registered on Create and Update at PreValidation or PreOperation that checks the lookup and throws InvalidPluginExecutionException when it is missing or cleared. It rejects writes from forms, the Web API, imports, integrations and flows. Test bulk messages too, and review who holds the privilege that allows callers to bypass custom logic.
Can Power Automate enforce a compliance rule on save?
Not as a blocking control. Dataverse-triggered cloud flows run asynchronously after the record has been saved, so they cannot reject the write. They are useful for flagging, notifying or correcting records after the fact, which can support an interim control, but the rule itself should be enforced by a synchronous plug-in.
What should an evidence pack for a Dynamics 365 compliance audit contain?
For each rule: its source, how it is enforced (plug-in step registration and the solution version that deployed it), the date enforcement went live with the deployment record, dated test attempts through the form, API, import and integrations, Dataverse audit history since enforcement, the report of pre-existing non-compliant records with fixes and exceptions, and who can bypass custom logic.
Should we build PCF controls to fix compliance gaps before an audit?
No. PCF controls run in the browser, so they improve the user experience but do not enforce anything for API, import or integration writes, and new UI shortly before an audit adds production risk. Enforce the rule server-side first, use supported out-of-the-box form features to guide users, and build PCF controls after the audit.
Where should you go next?
Dynamics 365 customization mistakes and fixes
Over-customisation, poor plug-in design and solution layering, with a refactor plan.
Dynamics 365 health check and technical audit
An independent review of security, configuration, performance and ALM with a prioritised remediation plan.
Hire a Dynamics 365 consultant or DIY
What a maker can own without code, and the walls where developer help becomes necessary.
Dynamics 365 audit trails and compliance
Who changed what, audit retention and exporting evidence from Dataverse.
Building a CRM in 60 days for an audit
When the audit needs a whole auditable process rather than one enforced rule.
Custom CRM Development
CRM on React, Node.js, PostgreSQL and .NET for organisations that need full control without Microsoft licensing.
Which solution is right for your business?
Tell us what you need. A senior consultant replies within one business day with a recommendation - Dynamics 365, Power Platform, or a custom-built CRM - not a sales script.