DataSource join problem


I’m a newbie to AX dev, and I have stumbled upon one problem I can’t really understand.

I have new form (Form1) with parent data source Table1 which has Inner join to InventTable (with inner join to EcoResProduct). I created grid (Grid1) in Form1 with Fields from all data sources and action pane with ‘NewLine’ button.

Problem is with ‘NewLine’ button. On click, I get dialog with comboBox: “Select a record type to create.” / Products, Product Variant, Product Master.

When I change Data Sources propertiy ‘LinkType’ to Delayed, the problem is solved.

Any ideas for keeping inner join on data sources, but override the dialog?

Links and joins are two very different things. If you use a link, the linked datasource is not a part of the parent query at all.

Now the question whether you really intend to create a new product. I would expect your goal is to create a new record in Table1, not in products - if it’s the case, you don’t want to “override the dialog”. You want to stop creating new products.

The dialog is related to table inheritance. If you’re create a new record in an abstract table, you have to choose a concrete child table to use. In this case, you would have to choose a type of product. It is possible to get rid of the dialog (by overriding FormRun.createRecord()), if you really want to use your Form1 for creating products. I suggest you read Developing with Table Inheritance before doing that.

Thanks for the heads up! I don’t want to create new product, so I need to figure out how to stop creating new product when creating a new record in Table1.

I didn’t know exactly how the dialog is displayed and I thought if I prevent the datasource from calling create(), the dialog would disappear. But it doesn’t seem to be the case.

If you don’t find any better solution, you’ll have to override createRecord() anyway. Also review whether you really have to have EcoResProduct there, instead of a concrete implementation (such as EcoResProductMaster).

Finally, I used a different source for necessary fields. I used existing view as a replacement for EcoResProduct. Thanks for table inheritance hint, that helped.