Fetch Active Theme and Extension Files in SuiteCommerce

Fetch active theme and extension files in SuiteCommerce using Gulp commands for local testing and development.

·3 min read·1 views·View Oracle Docs

The gulp extension:fetch command is vital for developers working with SuiteCommerce or SuiteCommerce Advanced (SCA). Before deploying or testing an extension locally, you must download the files for the currently active theme. This command retrieves HTML and Sass files for the active theme and any custom extensions that are active. It ensures that the necessary files are present in your local extension workspace, which is crucial for successful local testing and deployment.

Understanding the gulp extension:fetch Command

Running the gulp extension:fetch command does the following:

  • Downloads necessary HTML and Sass files for the currently active theme. Do not modify these files, as they are for reference only.
  • Downloads files for any custom extensions currently activated.

This command is essential as the developer tools need theme files to compile a local distribution for testing your extension. When you run this command, it will facilitate subsequent testing and deployment processes because it provides the developer tools with the required files.

Important Considerations

  • Overwrite Warning: Executing gulp extension:fetch will overwrite any existing extension files in your local workspace. Ensure that you've deployed your current work to NetSuite before proceeding to avoid losing any progress.
  • Published Extensions: Note that the command does not fetch files for published extensions, which are installed as part of a SuiteApp and cannot be edited due to copyright restrictions.

Steps to Fetch Active Files

  1. In your local development environment, open a command line or terminal and navigate to the top-level extension development directory.
  2. Run the command:
    gulp extension:fetch
  3. If prompted, provide your Authentication ID, which is utilized for representing your NetSuite account and role. If you’ve previously created an ID, the tools will not prompt for it again.
    • To switch accounts, utilize the --to parameter and create or select a different Authentication ID.
  4. Choose your NetSuite account, role, and the specific domain with the active theme or extensions you wish to access.
  5. Optional: If you have any active extensions for the selected domain, you can download their working files.

The gulp extension:fetch command creates a subdirectory under your Workspace/Extras directory specifically for the fetched theme files. These are strictly for use by developer tools.

Conclusion

By understanding and utilizing the gulp extension:fetch command effectively, developers can streamline the process of extension development within SuiteCommerce. Always ensure that your working files are backed up to prevent loss during the fetching process.

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

Key Takeaways

  • Use the gulp extension:fetch command to download active theme and extension files for SuiteCommerce.
  • Be cautious of overwriting existing files to avoid losing unsaved work.
  • Ensure you have the correct permissions and account information before executing Gulp commands.

Frequently Asked Questions (4)

What happens to my local files when I run the `gulp extension:fetch` command?
Running the `gulp extension:fetch` command will overwrite any existing extension files in your local workspace. It is important to deploy your current work to NetSuite beforehand to avoid losing progress.
Does the `gulp extension:fetch` command work with published extensions in SuiteCommerce?
No, the `gulp extension:fetch` command does not fetch files for published extensions. These extensions are part of a SuiteApp and are protected by copyright, meaning they cannot be edited.
What prerequisites are there for using the `gulp extension:fetch` command in SuiteCommerce?
Before using the command, ensure your local development environment is set up with the necessary developer tools, and you have the correct Authentication ID for your NetSuite account and role.
Can I fetch files for custom extensions using the `gulp extension:fetch` command?
Yes, the command downloads files for any custom extensions that are currently activated in your SuiteCommerce environment.
Source: Fetch Active Theme and Extension Files 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 →