I have a custom table1 with the following fields
and another custom table2, the relation between table1 and tabl2 is Id
Number Id codeX codeY Field1
and i overrided the lookup of this field codeX in salesLine, by creating a view that has table2 and table1, where it returns the following:
CodeX, name, Field1
so now when i click on the dropdown of this field I'm seeing this:
CodeX name Field1
codex1 name1 fieldz
my issue is if i choose in the lookup codex1 with name2, it actually takes codex1 with name1 instead.
[ExtensionOf(FormDataFieldStr(SalesTable, SalesLine, CodeX))]
final class SalesTableFormSalesLineDS_CodeX_Extension
{
public void modified()
{
FormDataSource formDataSource = element.datasource();
SalesLine salesLine = formDataSource.cursor();
CodeX codeX = salesLine.CodeX;
next modified();
Table1 table1;
Table2 table2;
select firstOnly CodeX, Id from table2
where table2.CodeX == salesLine.CodeX
join Id from table1
where table1.Id == table2.Id
salesLine.CodeX = codeX;
salesLine.Id = table2.Id;
}
}