Foreign Key Error

Foreign Key Error


Hi, I'm getting a new (for me) error when I try to publish an eSpace. I just added a new managed entity that is a join table between a managed entity and an imported entity (COUNTY) from another DB.

The error it's throwing is on the foreign key constraint in the join table pointing to the COUNTY table as a COUNTY Identifier.

Is it not permitted to use an Identifier (FK) field to an external DB?

Hi Jeffrey.

I'm not sure that would be the case - I mean, at least to me, that's unheard of.

What error are you getting, specifically? What database are you on - and what database are you importing from?


Paulo Tavares

It's a SQL Server hub server for the managed entity and a SQL Server linked server as the unmanaged entity.
Hi Jeff

Since the external entity lies on a different database, the database engine doesn’t allow to create a foreign key constraint between a table existent on the OutSystems data model, and an external entity.

So, in OutSystems, when creating a referenced attribute, if you set the Delete Rule to either protect or delete between tables in different catalogs, this error will occur because the Agile Platform will attempt to create a foreign key contraint between both tables. You should be able to create referenced attributes, but with the Delete Rule set to Ignore.

For more information about the referenced attributes Delete Rules, please check the help topic

Let us know if the problem persists with the Delete Rule set to ignore.

If so, can you provide the espace file for analysis?


Miguel Simões João