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
And now everything is broken. Do I have to remove manualy this object in the database?
I found those entries in the fieldMetadata
And this one in relationMetadata
I removed the entry in relationMetadata first and then the three others.
OK I tried again with "Headquarters" and not "HQ". Same error
My Countries Object is not very fancy
I removed entries from Headquarters as well. Any idea what is wrong here?
interesting, don't know what's wrong but I'm interested troubleshooting this with you
are you using the latest version?
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
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
Oh, I see. Why it doesn't make sense?
In my case, I should name the field differently in "Countries"?
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
Oh ok, I get it 👍 Thanks
OK, I confirm, it does work with different names
Thanks for your help
ok, I'll create a ticket
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...
Good catch, thanks for creating a ticket!