Hi, I have an app that has multiple tables w...

(Asaf Weis) #1

Hi,

I have an app that has multiple tables with ref columns. It’s great for pulling info from other tables and associating records however I’d like to prevent users from adding records to tables from within a ref column.

How can i ensure that the only way to add a record is from the record’s original table?

(Dinh Nguyen Nguyen) #2

@Asaf_Weis Hi Asaf, right now it is not possible to disable the add button in an inline ref view if the source table of this inline view allows adds. However, there’s a work around. Instead of hooking the reverse ref column to the original table, you can hook it to a slice of this table instead. If the slice does not allow adds, the inline ref view also not allow add, and the add button will be disabled.

To do this, first create a slice of the table being referenced. Set the permission of the slice to not allow adds.

Next, open the column definition of the reverse ref column. The app formula of the column should look like this:

REF_ROWS(“Name of referenced table”, “Name of this table”)

Change this formula to the following:

REF_ROWS(“Name of the slice”, “Name of this table”)

Also in the column definition, the first entry in the ElementTypeQualifier of the column should look like this:

“ReferencedTableName”: “Name of referenced table”

In this entry, replace the name of the referenced table with the name of the slice as follows:

“ReferencedTableName”: “Name of the slice”

Make sure you do not change anything else in the ElementTypeQualifier of the column.

Finally, save your changes.

(Reza Raoofi) #3

I have also found myself in a number of scenarios when I didn’t want to allow user to be able to add new row to the referrenced table right from the drop-down list.

I see the Ref column as relationship between 2 entities, so try to avoid using slice instead of table for a Ref column.

I understand that currently it is not possible, but the above workaround seems a little too much of an effort.

I wish there was an option to just remove this New button that by default is always there in the drop-down list.

(Asaf Weis) #4

Thanks,

I also thought i could do it using a vlookup in the table which would automatically fill in the ref field but have the dropdown as the selector.