I am under the impression that a custom SObject can have no more than 500 (or 800) fields in total across all namespaces. From the Salesforce Features and Edition Allocations documentation there is this table entry:
ENTERPRISE EDITION UNLIMITED AND PERFORMANCE EDITION
Custom fields per object 500 800
and this footnote:
An org can’t have more than 800 custom fields, regardless of the
edition or source of those fields. For example, an Enterprise Edition
org can have 500 custom fields per object, and 300 more fields
installed from a managed package for a total limit of 800 fields per
object.
But when you add say 3 fields in the Classic UI Setup to an installed managed package custom object in a "Developer Edition" scratch org, the "Limits" UI says:
Usage Limit
3 500
rather than subtracting the number of fields on that object already in the managed package.
Is this "Limits" UI presenting the truth here? Where does the 300 in "300 more fields installed from a managed package" come from in this? Is there a clearer explanation of this somewhere in the Salesforce docs? Or if you are clear on the rules, post your own explanation as an answer.
PS
Sanket has flagged this existing question and answer Custom Field Limits For Managed Packages. That does suggest that the Value0
to Value500
idea described in this old The Force.com Multitenant Architecture document is a thing of the past and that perhaps the limit today is 500 fields per namespace. Or a 500 field row per namespace so that one SObject record is sometimes represented by multiple 500 field rows?
The last comment in the existing question and answer (from 2016) includes:
Still seeing inconsistent behaviour across environments though
Best Answer
I picture custom field limits as a battle between the fields I create and the fields I install. Managed package fields live in the buffer between the edition limit and the hard limit, and I don't have to worry about them affecting the edition limit until I install so many fields that they don't fit in the buffer.
Developer Edition orgs have their own edition limit of 500 custom fields. The 300 is the difference between the hard limit and the edition limit for the edition. So the UI is still showing you the effective limit on how many fields you can create in that org. Unless you have > 300 managed fields, the effective limit is the edition limit.