Organizing Source Code for Custom Modules in SuiteCommerce

Organizing source code for custom modules in SuiteCommerce ensures compatibility with future upgrades, optimizing development practices.

·2 min read·View Oracle Docs

TL;DR Opening

Organizing source code for custom modules in SuiteCommerce is critical for ensuring that customizations remain compatible with future upgrades. By following structured naming conventions and directory placements, developers can maintain their own custom features while leveraging the latest enhancements from SuiteCommerce.

Why Organize Source Code?

When customizing or extending SuiteCommerce Advanced (SCA), it's important to adhere to organizational best practices. Properly organizing your source code helps facilitate future upgrades and ensures your customizations are easy to manage. For projects using SCA, the structure of code directories impacts deployment and integration with new releases.

Best Practices for Source Code Organization

The organization of custom modules varies based on the version of SuiteCommerce Advanced used. Here’s a guide to the directory structure for different versions:

  • For SCA 2020.1 and later:
    Create a directory named extensions within the SC_<version> directory. Store all customizations there. Example structure:

    none
    1SC_20.1
    2 Advanced
    3 Backend
    4 Commons
    5 extensions
    6 gulp
    7 ...
  • For SCA 2019.2:
    Create an extensions directory within the SC_<version>_Live directory:

    none
    1SC_19.2_Live
    2 Advanced
    3 Backend
    4 Commons
    5 extensions
    6 gulp
    7 ...
  • For SCA 2019.1 and earlier:
    Place all customizations in an extensions directory within the Modules directory:

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

Naming Conventions

When naming your modules, adopt a versioning convention for clarity. For example:

  • New module: MyCustomModule@1.0.0
  • Extension of the existing Case module: CaseExtension@1.0.0

This consistency aids in management and upgrades over time.

Template Overrides

For template overrides, it's recommended to have a dedicated custom module for each override. Each template can only be overridden once, so organizing these overrides separately can mitigate potential conflicts, especially when different modules depend on unique templates.

Conclusion

Organizing source code in your custom SuiteCommerce modules is essential for ensuring compliance with upgrade paths and the maintainability of custom features. Establishing clear directory structures and naming conventions sets a solid foundation for a successful development lifecycle.

Key Takeaways

  • Maintain directory structures based on SCA version for ease of upgrades.
  • Use versioning conventions for naming custom modules.
  • Isolate template overrides for better conflict management.

Source: This article is based on Oracle's official NetSuite documentation.

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 General

View all General articles →