Error when adding a relation to an object

I try to add a relation (HQ for HeadQuarters) to a Company. A Company HQ has to belong to One Country (Another Object). I got a 500 error. Any idea why?
16 Replies
greg [iero]
greg [iero]OP10mo ago
And now everything is broken. Do I have to remove manualy this object in the database?
greg [iero]
greg [iero]OP10mo ago
I found those entries in the fieldMetadata
No description
greg [iero]
greg [iero]OP10mo ago
And this one in relationMetadata
No description
greg [iero]
greg [iero]OP10mo ago
I removed the entry in relationMetadata first and then the three others.
greg [iero]
greg [iero]OP10mo ago
OK I tried again with "Headquarters" and not "HQ". Same error
No description
greg [iero]
greg [iero]OP10mo ago
My Countries Object is not very fancy
No description
greg [iero]
greg [iero]OP10mo ago
I removed entries from Headquarters as well. Any idea what is wrong here?
charles
charles10mo ago
interesting, don't know what's wrong but I'm interested troubleshooting this with you are you using the latest version?
greg [iero]
greg [iero]OP10mo ago
Yes 0.3.2 from docker Earlier I tried to add a "Founders" field in Companies with a relation to Many "People". It failed, maybe it is the same issue
charles
charles10mo ago
ok, I think I found the issue : we have a bug whenever you put the same fieldName on both side of the relation. It does not make sense to do that but it should not break Twenty
greg [iero]
greg [iero]OP10mo ago
Oh, I see. Why it doesn't make sense? In my case, I should name the field differently in "Countries"?
charles
charles10mo ago
Not sure what you are trying to model but I think you want company "headquarter" to be a country. In this case, I would expect: country "companies" to represent the other side of the relation. On your screenshot you have country.headquarter that is an array of companies
greg [iero]
greg [iero]OP10mo ago
Oh ok, I get it 👍 Thanks OK, I confirm, it does work with different names Thanks for your help
charles
charles10mo ago
ok, I'll create a ticket
greg [iero]
greg [iero]OP10mo ago
I found a funny bug playing with this; https://github.com/twentyhq/twenty/issues/4385 When I add another "People" type field (name Founders here) Twenty cannot count the number of People in a Company anymore
GitHub
Companies "People count" broken when adding another People field · ...
When I add a Founders field with "People" type, it cannot calculate the number of people Here is my data model with a new "Founders" field : Here the Company see the Founder but...
charles
charles10mo ago
Good catch, thanks for creating a ticket!
Want results from more Discord servers?
Add your server