[Human Readable Change History] Error in Translation_GetValuesFromReferencedEntity

[Human Readable Change History] Error in Translation_GetValuesFromReferencedEntity

  
Forge Component
(20)
Published on 2017-11-28 by Johan den Ouden
20 votes
Published on 2017-11-28 by Johan den Ouden

In our test environment we are getting the following error:

Error in advanced query GetReferencedRecord_Original_OSUSR in Translation_GetValuesFromReferencedEntity in DiffEntityDataToText (SELECT @NameAttribute   FROM OSUSR@PhysicalTableName   WHERE @IdAttribute = @RecordId): Incorrect syntax near the keyword 'Key'.

However this error does not occur on our dev environment or prod environment...

Strange. Do you have an Entity or Attribute named "Key" by any chance?

Also, what's the platform (.NET or Java) and database (SQL Server, Oracle, or MySQL)?

J.Ja

Running on .NET, SQL Server.

It's happening at multiple entities, but strangely only happening in the test environment.
The entity does have a field called Remark and the entity itself is named Quote (there are no other attributes with a K).

Solution

I have found the problem after searching for a long time.

The problem in the queries in the action "Translation_GetRefEntityNameAttribute" are missing the where clause to only look in active attributes. So there is a change the query gives an atrtibute back which does not belong to the table anymore. Later on this gives the problem you describe.

Add to the queries:

SyntaxEditor Code Snippet

AND {Entity_Attr}.[Is_Active] = 1



Solution

If someone can add me to the team please I can fix this and upload a new version of this component.