I have created a form for my new table. In this form I have added the EcoResProduct table as data source via an inner join, as I want to show the product search name in my grid. The Data source has set Allow Create, Allow Delete and Allow Edit all to /No/. I have overridden the validateWrite and write functions in the datasource, to make sure no entry can be inserted in the EcoResProduct table from my new form.
However, when I try to create a new entry for my own table in the form, I still get a popup where I have to select what type of Product I want to create:
If I just select one of those, I can continue, and my form works normally. I can save the entry in my new table without problems. However, I still want to get rid of this annoying popup.
However, for some reason this doesn't seem to work for me.
So the datasources in my form are as follows:
- MyTable
- InventTable (inner join with MyTable on ItemId)
- EcoResProduct (Inner join with InventTable)
Maybe the problem is that in the example, the abstract table is the first datasource in the form, while in my example it is the third.
I have overridden the createRecord function in the form as follows:
public void createRecord(str _formDataSourceName, boolean _append = false) { Map typesToCreate = new Map(Types::String, Types::String); typesToCreate.insert(formDataSourceStr(MyTable, EcoResProduct),tableId2name(tableNum(EcoResProductMaster))); MyTable_ds.createTypes(typesToCreate); EcoResProduct_ds.createTypes(typesToCreate); super(_formDataSourceName, _append);}
I have tried setting the createTypes on the primary datasource, as well as the EcoResProduct datasource, but it seems to make no difference.
Who can guide me in the right way to solve this?