Buttons That Vanish on Customised Quote Forms: Form-Independent Commands
Why managed solution commands break when customers copy or replace forms, how to build them so they do not, and why imports fail.
Buttons vanish because they depend on the form. A custom enable or display rule reads a field that the customer's copied Quote form does not have, throws, and the button is hidden. Event handlers live on one form, so a copy keeps the handlers it had on the day it was made and a new form has none, and your managed updates never reach it. The fix is form-independent commands: define the command on the table, write rule and action scripts that check for missing fields and read data through the Web API instead, and move the business logic into a server-side Custom API bound to the quote. Import failures need a separate check, covered below.
Why do managed solution buttons disappear when customers customise the Quote form?
Because something in the command depends on the form, and the form changed. Customers rarely edit the Quote form your solution ships; they save a copy, rebuild one from scratch, or switch to a form another partner made. Three things then break:
- Custom enable and display rules: a JavaScript rule receives the primary control and reads a field or control. On a form without that field the call returns null or throws, the rule fails, and the button is hidden or disabled.
- Form event handlers: form libraries and on load or on save handlers are stored per form. A copy keeps the handlers it had on the day it was copied and a new form has none.
- Managed updates: when you ship a new version, the changes go to your form. The customer copy, which lives in their own layer, keeps the old wiring for good.
Which command patterns survive a copied or replaced form?
The ones that ask the table, not the form. Compare what usually ships with what survives:
| Breaks when the form changes | Survives a copied or replaced form |
|---|---|
| Rule script reads a field that must be on the form | Rule checks the field exists, otherwise reads the record through the Web API by id |
| Rule passes only when a specific form id is open | Rule based on the table, the record state and the user privileges |
| Button logic runs in browser script, field by field | Button calls a Custom API bound to the quote; the logic runs on the server |
| On load handler hides or shows the button | Display and enable rules decide visibility, with no form script needed |
| Script throws when a control is missing | Script returns a clear result and logs what was missing |
How do you write command scripts that do not assume a form?
Treat the form as optional. A rule or action script gets the primary control, which may be a form or a grid, so it should first ask which one it has. On a form, read a field only after checking it exists; if it does not, read the record through the Web API by its id. Return true or false rather than throwing, and keep asynchronous rules quick and cached, because the client waits for them before drawing the command bar.
The same script then works on your form, the customer copy, a form they built from scratch and the grid. Supported client API only: the deprecated patterns and the context resolver to replace them are covered on common Dynamics 365 customization mistakes.
Why should the button logic live in a server-side Custom API?
Because then the form does not matter at all. A Custom API bound to the quote takes the record and any parameters, runs the logic in a plug-in, and returns a result. The command only calls it and shows the outcome. The logic is in one place, runs under the user security, can be tested without a browser, and can be called by Power Automate, integrations and other apps as well as by the button. If the customer replaces the form, the button still works, and if they remove the button, the process still exists.
How we design plug-ins and Custom APIs for product companies, and what goes into the managed solution, is on Dataverse plug-in development for ISVs.
Should the commands move from classic ribbon to modern commanding?
Over time, yes, but it does not by itself fix form dependency. Modern commands from the command designer can run JavaScript or Power Fx and are where Microsoft is investing, and classic ribbon customisations are where release waves cause the most surprises. Modern commands are scoped to an app and a command bar location, so check which apps your customers use and ship the command to each. A Power Fx visibility formula that reads a field on the form has the same weakness as a script; base it on the record. The wave-by-wave test routine is on release wave testing for ISVs.
What are the steps to make quote commands form-independent?
Six steps, in this order:
- Find every form dependency: List each command, enable rule, display rule and form event handler in your solution, and note every field, control, tab or form id it reads or assumes.
- Define commands on the table, not the form: Keep commands in the table command definition, classic or modern, and remove rules that only pass on your own form, so the button appears on any main form for the quote.
- Make rule scripts form-independent: In custom enable and display rules, check that a field exists before reading it, fall back to reading the record through the Web API by id, return a clear result instead of throwing, and cache asynchronous results.
- Move the logic to a Custom API: Turn what the button does into a Custom API bound to the quote, with a plug-in behind it, and let the command only call it and show the result.
- Handle the form events you truly need: For behaviour that must run on load or save, ship a small library, document how customers add it to their own forms, and provide a check that lists forms missing it.
- Test on copied and replaced forms: Add a copied Quote form, a new form without your fields, and a second app to your test environment, and run the command tests on each before every release.
Why does the managed solution import fail or hide the button at some customers?
When the button is missing straight after an import, or the import fails, the cause is usually in the target environment rather than in the form. Check these first:
- Missing dependencies: the command refers to a web resource, field or other component that is not in the solution or not yet installed at the customer. The import reports the missing component; ship it or make the reference optional.
- A component that already exists unmanaged: a form, web resource or field with the same id was once imported unmanaged into the customer environment, and a managed version cannot overwrite it. Remove or convert the unmanaged copy first.
- Another solution hides your button: a HideCustomAction from the customer or another vendor, or a command with the same id, wins over yours. Check the command definitions and solution layers on the quote table.
- An unmanaged layer above yours: a customer change to your component sits on top, so your new version installs but users still see the old one. The layering model is on common Dynamics 365 customization mistakes.
- Privileges: a display rule on a privilege the customer security roles do not grant hides the button for everyone except administrators.
- An upgrade that deleted a component: an upgrade import removes components that are no longer in your solution, including ones a command still refers to.
How does Solzet help product companies with commands on customised forms?
Solzet works on the Dataverse side of Dynamics 365 add-ons for product companies: our own senior consultants and developers audit your commands, rules and form handlers for form dependency, rewrite them to be form-independent, move the logic into bound Custom APIs, and add copied and replaced forms to your test environment. We can do it white-label as part of your product team, on the terms on white-label Dynamics 365 subcontracting. If customers already have the add-on installed badly by partners, the remediation pass is on auditing customer implementations of your add-on.
For customers who would rather not carry Microsoft licensing, we also build a custom CRM. We recommend the right solution: Dynamics 365 (Customer Engagement, Business Central or Finance and Operations), Power Platform, or a custom-built CRM. One team for CRM, ERP and the integration between them.
What do people ask us?
Why does my ribbon button disappear on a customised quote form?
Usually because a custom enable or display rule reads a field or control that the customer form does not have. The rule fails and the button is hidden or disabled.
Do form event handlers carry over to a copied form?
A copy keeps the handlers the original had when it was copied. Later managed updates to your form do not reach the copy, and a form built from scratch has none.
What is a form-independent command?
A command defined on the table whose rules and scripts do not rely on a particular form. Scripts check fields exist, read data through the Web API when needed, and call a server-side Custom API for the logic.
Why use a Custom API behind the button?
The logic runs on the server in one place, under the user security, testable without a browser, and callable from flows and integrations as well as the button, whatever form the customer uses.
Does moving to modern commanding fix it?
Not by itself. Modern commands are scoped to an app and location, and a visibility formula that reads form fields has the same weakness. Base visibility on the record and ship to each app.
Why does our managed solution import fail at one customer?
Common causes are missing dependencies, a component that already exists unmanaged in the target, and conflicts with another solution. The import log names the component involved.
Can Solzet rework our add-on commands white-label?
Yes. Our own senior consultants and developers audit and rewrite commands, rules and handlers, move the logic to Custom APIs and extend your tests, under your brand.
Where should you go next?
Common Dynamics 365 customization mistakes
Solution layering, unsupported script and how to refactor.
Release wave testing for ISVs
The routine that catches broken commands before customers do.
Dataverse plug-in development for ISVs
Plug-ins and Custom APIs for product companies.
Auditing customer implementations of an add-on
A remediation pass across badly installed customers.
White-label Dynamics 365 subcontracting
Capacity under your brand.
Custom CRM development
A CRM without Microsoft licensing, when that fits better.
Which solution is right for your business?
Tell us what you need. A senior consultant replies within one business day with a recommendation (Customer Engagement, Business Central, Finance and Operations, Power Platform or a custom-built CRM), not a sales script.