Hi,
I'm trying to use this component, and don't understand how to make sure foreign keys are also shown in a readable format.
So my assumption is that this component is using the entity and EntAttr tables to show a meaningfull value for foreign keys based on the label attribute property.
This is an example in my database
My action entity has a reference to this static entity, when I'm changing the value of that reference attribute in Action, it runs into an error.
Error executing query. Error in advanced query GetRefRecord_OSUSR in Translation_GetRefValue in DiffEntityDataToText (SELECT @NameAttribute FROM OSUSR@PhysicalTableName WHERE @IdAttribute = @RecordId): Invalid object name 'OSUSR_AQI_ACTIONSTATUS'.
So that tablename is correct except for the AQI being lower case. I tried with aqi in a clone of the component, but that's not it.
The table is also in another catalog than the human readable component.
The module where action table sits, is part of a reactive app.
Does this ring a bell for anyone, what direction should I look for the problem ?
Dorine
Ok,
done some more testing, and I can confirm that the reason is that these tables are in a different catalog than (Main).
I cloned this component and made some changes and got it to work :
1) added DatabaseCatalog back to TableName structure
2) added logic to Translation_GetTableName to determine the catalog name
3) Added a branch to GetRefValue logic for cases where table is in other catalog
I tested this with my entities that are in a named catalog, and at first glance, this seems to work.
Of course, this is not tested thouroughly yet, and might only work for SQL Server, maybe, I don't have Oracle.
Am I correct in assuming that there are no plans at the moment to make this kind of improvements to the component ? If not, I'll just soldier on with my cloned version.
Hi Dorine,
I have seen a similar problem before where a foreign key table this sort of query would not work when the table is on another catalog.
Unfortunately though, I didn't find a generic way to query the table in another catalog, so didn't find a solution to the problem.
Kind regards,
Stuart
I would truly appreciate it if, instead of working with a clone copy, you joined the team, applied your changes to the existing copy, and then published it to the Forge. That way everyone can get access to this fix, and you'll get credit for the fixes. :)
J.Ja
I'd be glad to,
but would like someone else to verify if my change doesn't have adverse side effects.
uploaded new version to correctly read referenced entities that are not in the main catalog. Changes only made for SQL Server.