Show a property only in one workflow state
A property that only matters at one point in a process should only be on screen at that point. This example adds a Not Completed Review property to a case, and makes it appear — and become required — only when the case moves into the Not Completed state.
It touches three places, which is what makes it a useful example: the vault’s metadata structure, M-Files’ own metadata card rules, and a CtrlPortals portal rule. The portal rule is what carries the behaviour into the portal.
Before you start
Section titled “Before you start”- A vault with a Case object type and a workflow that includes a Not Completed state.
- A CtrlPortals portal bound to the Case object type.
- Administrative access to the vault through M-Files Admin.
-
Add the property to the class.
In M-Files Admin, expand Metadata Structure (hierarchical view), then the Case object type. Right-click the Case class, select Properties, and add a text property named
Not Completed Review. -
Make it a conditional property on the metadata card.
Under Configurations → Metadata Card Configuration → Rules → Case rules, create a sub-rule named
To_NotCompleted.Select the Not Completed Review property in it, and set both Is Additional and Is Required to Yes.
This is what M-Files itself does. The portal needs telling separately.
-
Add a portal rule.
Under Other Applications → CtrlPortals - VAF, expand Portals and select the case portal. Add a rule named
TransitionIntoNotCompleted, with conditions that make it true on transitions into the Not Completed state.A portal rule is a named condition. Naming it after what it means, rather than after what it does, is what makes the next step readable.
-
Use the rule on the field.
In the portal’s components, find the field the property should appear in — a field row in the header segment puts it where nobody can miss it.
Enter
TransitionIntoNotCompletedin Required when, Additional when and Show when.
What you have now
Section titled “What you have now”A case portal where the review property is invisible until the case moves into Not Completed, at which point it appears and has to be filled in before the transition completes.
The same three steps work for any property that belongs to one part of a process. The portal rule is the reusable part: one rule can gate several fields.