Command
Updated
A document command is the only user entry into a subtype change. After Save, the card does not let the user pick a subtype. The button checks, then sets the target Subtype. The engine replaces movements and runs the posting scripts of the target only.
Note
Without that command the document stays a draft in the UI, however many scripts hang on the later subtype. Events still run for any transition, including API. The command is what the user presses.
Commands that do not change subtype (fill prices, explode a BOM) are fine. They do not post the document.
A dictionary command has no subtypes. The button appears on the dictionary card. It does not need a menu item.
The text the user reads on failure is a resource, shown with CreateUserMessage. See what the user reads when an operation fails.
A question that depends on data is context.Confirm — Asking the user from a command. A static "Are you sure?" is requiresConfirmation on the json.
Wrap somebody else's command with Chain of Command. A missing next is ZOCOC003.
document.Subtype = … from a service or a test is for system transitions, not a substitute for the button.
See also#
- Document
- Posting script
- Menu — document commands that are also list actions still need the object in the ribbon
- Scripts