Plugin: Opening modal with "New record" form inside

Hi Dato community,

I would like to know if there is a way to open a modal with plugin that would wrap the “new record” form.

As an example, I would like:

  • first to add an entry in field context menu (another topic described here :slight_smile: ) “Create a new MyModel record” (where MyModel is a model I’ve created)
  • then … when the user click on it, it would open a modal with a new MyModel instance to be created.

This is the exact same behavior as you natively have with Reference Link that provides a “Create New” button when the user has permission:

Thanks for your help.

Best regards.

I think you can do this with ctx.createNewItem(). Does that work for you?

Thank you !

Perfect.

1 Like