How to display a specific form mode in a programmatically displayed form I have a custom entity type, property.  In admin/structure/display-modes/form I created a new form mode for this entity type, machine name is property.property_status.  It only shows one field on the form.

I am now trying to show that form mode on a custom page.  Right now I'm using:
\Drupal::service('entity.form_builder')-&gt;getForm($property, 'property.property_status') but I get the error:
Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException: The "property" entity type did not specify a "property.property_status" form class.

Any ideas?  Thanks!
You need to specify a form operation in the handler section of the custom entity:

/**
 * @ContentEntityType(
 *   id = "property",
 *   handlers = {
 *     "form" = {
 *       "default" = "Drupal\mymodule\Form\MyEntityForm",
 *       "status" = "Drupal\mymodule\Form\MyEntityForm",


You can define multiple operations for the same form class. In this example I used status for the form operation, because this name usually doesn't contain the entity type name.

Then you should be able to use the form mode status in the entity form builder:

\Drupal::service('entity.form_builder')-&gt;getForm($property, 'status')