KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Remember to declare component namespace for component classes
PRODUCT: 4D | VERSION: 20 | PLATFORM: Mac & Win
Published On: May 6, 2024

When building a component for use of its classes in a host project, don’t forget to declare its namespace in the class store. Otherwise, the component’s classes and functions will not be exposed in the host. To do this, before building the component, go to the General page of the matrix project’s Structure Settings and enter a name in the Component section.



Then, after building and installing the component, any of its classes and functions will be available to use in the host project by accesing the namespace (e.g. "cs.myNamespace.myClass"). Make sure that the namespace is unique enough that it will not conflict with any other component's namespace in the same host. If two components have the same namespace in a host project, the classes of only one of those components will be accessible in the host.