Add button disabled in detail linked to view

  • 20 January 2023
  • 1 reply

Userlevel 1
Badge +4

Due to performance reasons, we have created some views on top of some main tables and linked them to the original table.

From the grid (view) we show in the detail screen the form of the table itself.
But then the add button is disabled.
For the table itself the Add options are enabled in the subject settings.

Also in the layout procedure we don't manipulate the @add_button_type and it is parsed with value 0
I think this is because of the 1:1 relation between the gridview and the table itself.

How to enable the default Add button?



Best answer by Anne Buit 23 January 2023, 09:05

View original

This topic has been closed for comments

1 reply

Userlevel 7
Badge +5

When you would add a record to the view, the UI would not know how to navigate to the newly added record. It does not know that the record in the view and the parent table are logically the same entity.

You can circumvent this but it is a bity tricky.

First, you’ll need to trick the UI into thinking it is not a 1:1 relationship. You can do this by adding an arbitrary primary key column to the view, e.g. extra_id with value 1 and default value 1.

Now, you will be able to add records but when you add a record it will disappear with a message saying that the added row cannot be found.

You can resolve this using a process flow that navigates the parent table to the newly added row.