Hello,
Could you please help me AX stars? I have a form which has got a field an itemName field. It's got via display method and actually it contains field Name from table ecoresproducttranslation. I can't filter it. I was tasked to recreate the same field but so that I can filter it. It's done via creation of the view as I read. Please see correlations between fields in design and form fields (sorry for russian labels).
Also form contains a field InventSum_ItemId. It's a field ItemId from table InventSum. I created a view which contains the needed field Name from ecoresproducttranslation table and ItemId. Now I need to somehow connect filed ItemId from my view and ItemId from the form so that I could see the correct Name field on the form. I've read that it's done via init() method of the form
I've read the following code:
itemNameAzat_ds.query().dataSourceTable(tableNum(itemNameAzat)).relations(false); itemNameAzat_ds.query().dataSourceTable(tableNum(itemNameAzat)).addDataSource(tableNum(InventSum)).addLink(fieldNum(InventSum, ItemId),fieldNum(itemNameAzat,ItemId)); info(itemNameAzat_ds.query().dataSourceNo(1).toString());
But it takes multiple records because field ItemId is repeating in the InventSum table.
That's not what I expect but I understand why it happens. The query works fine. Simply not what I need. I need the highlighted column gives the same values as the left one next to it. But I also don't understand why field ItemId from inventSum table on the form shows unique values? IN the original table there are repeating values. Please see below
I hope I've explained the things clear enough. Please feel free to ask any info.
Many thank sin advance.