Organize Source Code for Custom Modules in SuiteCommerce

Organizing source code for custom modules in SuiteCommerce ensures efficient upgrades and management of customizations when developing for eCommerce.

·2 min read·View Oracle Docs

To maintain a well-structured environment when working with SuiteCommerce Advanced (SCA), developers should adopt best practices for organizing source code related to custom modules. Establishing consistent naming conventions and directory structures helps ensure that future upgrades and changes can be made smoothly without disrupting existing customizations.

Directory Structure for Custom Modules

When organizing custom modules in SCA, the directory structure depends on the version you are using:

  • For implementing 2020.1 and later: Create an extensions directory within the SC_<version> folder. Place all customizations here, for example:

    none
    1SC_20.1
    2 Advanced
    3 Backend
    4 Commons
    5 extensions
    6 gulp
    7 ...
  • For implementing 2019.2: Create an extensions directory within the SC_<version>_Live folder and organize custom modules as shown below:

    none
    1SC_19.2_Live
    2 Advanced
    3 Backend
    4 Commons
    5 extensions
    6 gulp
    7 ...
  • For implementing 2019.1 and earlier: Store all custom modules in an extensions directory inside the Modules directory:

    none
    1SuiteCommerce Advanced
    2 ...
    3 Modules
    4 extensions
    5 suitecommerce
    6 third_parties
    7 ...

Naming Conventions

Consistent naming conventions for modules are crucial. Use a versioning system in the format module_name@x.y.z. For example, a new module could be named MyCustomModule@1.0.0, and an extension for the Case module might be called CaseExtension@1.0.0. This convention aids in version tracking and ensures clarity in module functionality.

Organizing Template Overrides

While overriding template files, it's important to follow certain conventions. Since a specific template file can only be overridden once, consider creating a dedicated custom module for all template overrides. This approach facilitates reuse among other modules that might extend view functionalities.

Key Consideration: Custom modules should follow organizational patterns that enhance collaboration and future development.

Conclusion

Adhering to these organizational guidelines not only makes it easier to find and manage your custom modules but also ensures your code remains compatible with future releases of SCA. Implementing a solid structure reduces technical debt and helps streamline the development process, thus enhancing overall productivity.

Frequently Asked Questions (4)

Does the source code organization for custom modules vary between SuiteCommerce Advanced versions?
Yes, the organization of source code for custom modules varies based on the SuiteCommerce Advanced version. For example, in SCA 2020.1 and later, customizations should be stored in an 'extensions' directory within the 'SC_<version>' directory, whereas in SCA 2019.1 and earlier, they should be within the 'Modules' directory.
How should I name my custom modules in SuiteCommerce?
When naming custom modules, it's recommended to use a versioning convention for clarity, such as 'MyCustomModule@1.0.0'. This approach is beneficial for future management and upgrade processes.
What directory should I use for customizing SuiteCommerce in SCA 2019.2?
For SCA 2019.2, customizations should be placed in an 'extensions' directory within the 'SC_<version>_Live' directory structure.
Is it possible to override the same template multiple times in SuiteCommerce?
No, each template can only be overridden once. It's recommended to create a dedicated custom module for each template override to manage potential conflicts, especially when different modules require unique templates.
Source: Organize Source Code for Custom Modules Oracle NetSuite Help Center. This article was generated from official Oracle documentation and enriched with additional context and best practices.

Was this article helpful?

More in Commerce

View all Commerce articles →