Many-to-many relationships between static entities
Question

Hi.

I am not being able to publish a static entity that manages many-to-many relationships between 2 other static entities. Does anyone know why?

Thanks!

Hi Mariap,


You have a relation N:M, so, you new create a new entity. Right? The new table, will have dynamic data? Can relations be changed?

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Data_Modeling/Entity_Relationships

mvp_badge
MVP

Hi Mariap,

What error are you get when try to do it?  I test it here and it works well.


Regards

Fabio Fantato


I have 2 static entities (imagine A and B) and I created a 3rd to have static association (imagine C), with foreign key AId and BId, with an unique index to make sure that no duplicate records exist. 

Message is "Generic SQL Error. Cannot insert duplicate key row in object 'dbo.OSUSR_...' with unique index ... The duplicate key value is (0,0)".

However, none of the records is (Null, Null).

Thanks

Hi,

I don't have any problem:

Check attributes and indexes in your 3rd table.

Paulo Cação wrote:

Hi,

I don't have any problem:

Check attributes and indexes in your 3rd table.

Hi,

Have you tried to set an unique index composed by A.Id and B.Id?

Thanks


I have exactly the same problem. In the static entity there are no NULLs to insert.

Generic SQL Error. Cannot insert duplicate key row in object 'dbo.OSUSR_UPY_LOCALES5' with unique index 'OSIDX_OSUSR_UPY_LOCALES5_9COUNTRYID_10LANGUAGEID'. The duplicate key value is (<NULL>, <NULL>).

Is this a bug in OutSystems? Did you make any progress?

Kind regards,

Rogier


I had the same error, but my solution was delete the unique index.

The thought the steps to insert a new static record that has others static entities as a field, are:

 1 - Insert every rows with 0 or null;

 2 - Consult the others stitaci entities to get the correct ID filtering by Label selected in service studio;

 3 - Update the new records from 0 or null TO the correct values.

It's work for me. I had the same erro tha you got guys and analyzing the deploy errors logs I arrived in this solution.

I hope you get this solution too.


"It's a big mistake create row with your own hands, and so create it duplicated" :D

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.