https://sonarly.com/issue/17028?type=bug When a workspace has a custom object (e.g. "Placement") that was deactivated, relation fields on active objects (e.g. Company.placements) still reference the inactive target. The GQL field generation throws because inactive objects are filtered from `objectMetadataItems` but their relation fields are not. Fix: ## What changed Two files modified to gracefully handle relation fields whose target objects are inactive/deactivated: 1. **`generateDepthRecordGqlFieldsFromFields.ts`** (line 57): Changed `throw new Error(...)` to `return recordGqlFields` — when a RELATION field's target object is not found in the active `objectMetadataItems` list, the field is simply skipped in the generated GQL fields. This is safe because the GraphQL schema won't include the inactive object's type, so requesting it would fail anyway. 2. **`useRelatedRecordCommands.ts`** (line 60): Changed `throw new Error(...)` to `continue` — when building the command menu's "Create related record" commands, relation fields pointing to inactive target objects are skipped. Users shouldn't see commands to create records for deactivated objects. ## Why The metadata store refactor (#18647, March 14) introduced `MinimalMetadataService` which filters objects by `isActive === true`. However, field metadata is loaded separately and includes ALL fields, including relation fields pointing to inactive objects. When `generateDepthRecordGqlFieldsFromFields` iterates over Company's fields and finds "placements" (a custom RELATION field pointing to a deactivated "Placement" object), it throws because the target object is not in the filtered list. The fix addresses the inconsistency at the consumer level — these are the two sites where the mismatch between filtered objects and unfiltered fields causes crashes. The `buildMorphRelationUpdateInput.ts` throw was intentionally left as-is since that's a write path where the error is appropriate.
The #1 Open-Source CRM
🌐 Website · 📚 Documentation · Roadmap ·
Discord ·
Figma
Installation
See: 🚀 Self-hosting 🖥️ Local Setup
Why Twenty
We built Twenty for three reasons:
CRMs are too expensive, and users are trapped. Companies use locked-in customer data to hike prices. It shouldn't be that way.
A fresh start is required to build a better experience. We can learn from past mistakes and craft a cohesive experience inspired by new UX patterns from tools like Notion, Airtable or Linear.
We believe in open-source and community. Hundreds of developers are already building Twenty together. Once we have plugin capabilities, a whole ecosystem will grow around it.
What You Can Do With Twenty
Please feel free to flag any specific needs you have by creating an issue.
Below are a few features we have implemented to date:
- Personalize layouts with filters, sort, group by, kanban and table views
- Customize your objects and fields
- Create and manage permissions with custom roles
- Automate workflow with triggers and actions
- Emails, calendar events, files, and more
Personalize layouts with filters, sort, group by, kanban and table views
Customize your objects and fields
Create and manage permissions with custom roles
Automate workflow with triggers and actions
Emails, calendar events, files, and more
Stack
- TypeScript
- Nx
- NestJS, with BullMQ, PostgreSQL, Redis
- React, with Jotai, Linaria and Lingui
Thanks
Thanks to these amazing services that we use and recommend for UI testing (Chromatic), code review (Greptile), catching bugs (Sentry) and translating (Crowdin).
Join the Community
- Star the repo
- Subscribe to releases (watch -> custom -> releases)
- Follow us on Twitter or LinkedIn
- Join our Discord
- Improve translations on Crowdin
- Contributions are, of course, most welcome!




