Hello,
I have a table with an int64 (no EDT) field, I want this field related to either the ERModelMappingTable or the ERFormatMappingTable (depending on an enum value).

In the form I have a reference group:

public Common lookupReference()
{
if(XYZ_ERTable.Direction == XYZ_Direction::Export)
{
return ERFormatMappingTable::lookup(this, CustVendOutPaymConstants::modelName, CustVendOutPaymConstants::creditTransferContainerDescriptorName);
}
else
{
return ERModelMappingTable::lookup(this, classStr(ERTableDestination) '#' tableStr(XYZ_XYZ_HeaderTableEntity));
}
}
So the lookup filtering works great, but when selecting an ERFormatMapping (The second relation) I get the error:

So what I'm looking for a polymorphic lookup, also the field to show a descriptive text and not a RecId (already does that but I'm not sure how).