NetSuite SuiteScript Meets Generative AI for Advanced Automation

blog image of a women with imaging on AI

Over the past few decades, NetSuite has positioned itself as a robust cloud-based ERP solution that powers countless businesses across the globe. With its suite of applications designed to streamline financial management, inventory control, and customer relations, NetSuite continues to evolve, staying ahead of the curve in today’s competitive market. One of the key pillars of this evolution has been the introduction and expansion of SuiteScript. This scripting environment empowers developers to customize and extend NetSuite’s functionality to meet unique business needs. Now, with the integration of generative AI capabilities through SuiteScript 2.1 and the N/llm module, NetSuite is stepping into a new era of intelligent automation and innovation.

SuiteScript 2.1 Overview

SuiteScript has been a foundational tool for developers aiming to tailor NetSuite’s ERP capabilities to specific business workflows. Over time, SuiteScript has undergone significant updates to keep up with modern development practices. SuiteScript 2.1 is the latest iteration, building on its predecessors with a range of new and improved features.

2.1 Key Advancements in SuiteScript 2.1

SuiteScript 2.1 introduces a variety of enhancements that make development more streamlined and efficient:

  • Advanced Language Capabilities: SuiteScript 2.1 supports modern JavaScript ES6+ features, including destructuring, the spread operator, and arrow functions, making scripts more concise and readable.
  • Modern Scripting Environment: With support for native Promises and async/await, developers can now write asynchronous code more clearly and maintainably, reducing callback hell.
  • Compatibility and Limitations: While SuiteScript 2.1 provides significant improvements, developers need to be mindful of compatibility with older code and runtime environments to ensure smooth transitions.

2.2 Code Example

Below is a simple example showcasing SuiteScript 2.1’s async/await feature:


define(['N/record'], function(record) {
  async function createCustomer() {
    // Try block to handle customer creation
    try {
      let customer = await record.create({
        type: record.Type.CUSTOMER,
        isDynamic: true
      });
      customer.setValue({ fieldId: 'companyname', value: 'Tech Innovators Ltd' });
      let customerId = await customer.save();
      console.log('Customer created with ID:', customerId);
    } catch (error) {
      console.error('Error creating customer:', error);
    }
  }

  createCustomer();

This example demonstrates the use of async/await to simplify the handling of asynchronous record creation in NetSuite.

3. Introduction to SuiteScript Generative AI APIs

NetSuite’s commitment to innovation has led to the introduction of Generative AI capabilities within its SuiteScript framework. The SuiteScript Generative AI APIs, part of the N/llm module, open up new possibilities for how businesses can harness artificial intelligence directly within their ERP system.

3.1 Overview of the Generative AI Integration

The integration between NetSuite and Oracle Cloud Infrastructure’s (OCI) Generative AI service allows developers to send requests to large language models (LLMs) and receive AI-generated responses. This feature is a step toward enhancing how data is processed and insights are generated within NetSuite.

Key Benefits:

  • Enhanced Productivity: Automate complex data analysis and content generation tasks.
  • Seamless Integration: Use SuiteScript to incorporate AI functionalities directly into business workflows.
  • Data Privacy: Data handled through the OCI Generative AI service remains secure, processed within Oracle’s infrastructure without being used for third-party model training.

3.2 How the SuiteScript Generative AI APIs Work

The flow of data through the SuiteScript Generative AI APIs can be summarized in these steps:

  1. A NetSuite developer uses the N/llm module to send a prompt to the LLM.
  2. NetSuite passes the prompt to the OCI Generative AI service, which processes it using the specified model.
  3. The LLM response is sent back to NetSuite, where the SuiteScript code utilizes it for various tasks.

 

define(['N/llm'], function(llm) {
  function generateAIResponse() {
    try {
      let response = llm.generateText({
        prompt: 'Summarize the current financial trends in our industry.',
        modelFamily: 'cohere.command-r-16k'
      });
      console.log('AI Response:', response.text);
    } catch (error) {
      console.error('Error generating response:', error);
    }
  }

  generateAIResponse();
});

In this script, the generateText method from the N/llm module is used to send a request to the Cohere Command R model and log the AI-generated output.

Supported LLMs

NetSuite’s SuiteScript platform integrates with a range of powerful large language models (LLMs) to enhance its capabilities, enabling automation, smarter decision-making, and more efficient workflows. These LLMs can process vast amounts of data, generate insights, and automate processes across various business functions. Some of the most notable models supported by NetSuite’s SuiteScript integration include:

  • Cohere Command R: Known for its high-performance retrieval-augmented generation capabilities, Cohere’s Command R model is designed for tasks requiring large-scale, complex data retrieval and reasoning. It excels in environments that require accurate, context-aware information generation, such as customer support, data analysis, and business process automation. This model is particularly useful when dealing with unstructured data like documents or logs, allowing businesses to gain deeper insights and more accurate predictions.
  • Meta Llama 3.1: Meta’s Llama 3.1 model offers a balance between performance and flexibility, optimized for various natural language processing (NLP) tasks. It is particularly effective at generating human-like text and understanding nuanced prompts. Its abilities in text generation, summarization, and conversational AI make it ideal for automating content creation, customer interactions, and handling detailed business queries. Meta Llama 3.1’s capacity for fine-tuning and customization also allows it to be tailored to specific industry needs, providing tailored insights and solutions for businesses.

Default Model Behavior

When using SuiteScript with generative AI APIs, the default behavior of the models is to generate results based on the specific inputs provided through the API. Typically, the models respond with generated text or data-driven insights that align with the context of the business processes. The integration of LLMs such as Cohere Command R and Meta Llama 3.1 ensures that these responses are relevant, context-sensitive, and aligned with the user’s specific data set. Whether it’s creating personalized customer communications, summarizing reports, or generating new content, the default model behavior ensures a consistent and effective output.

By leveraging these models, businesses can harness the full power of generative AI, enhancing the functionality of their NetSuite ERP and driving further efficiencies across their operations.

Usage Modes for Generative AI APIs

NetSuite’s integration with generative AI APIs provides flexibility in how businesses use AI-driven capabilities within their ERP system. The usage modes offered allow companies to scale AI capabilities according to their needs, whether for small-scale tasks or larger, enterprise-level applications. These modes provide different levels of access and control, allowing businesses to optimize their workflows.

Free Mode: Details and Use Cases

Free Mode offers a limited yet powerful way to leverage generative AI capabilities within NetSuite, designed for smaller or experimental use cases. This mode is ideal for businesses that want to test the waters of AI integration without committing significant resources upfront.

Key features of Free Mode:

  • Basic Functionality: Users can access fundamental AI features, such as generating text summaries, analyzing small data sets, and automating basic content creation.
  • Limited API Calls: There may be restrictions on the number of API calls or the size of the data being processed, making it best suited for limited or low-volume tasks.
  • Cost-Effective for Small Teams: This mode is particularly advantageous for small businesses or teams that want to experiment with AI without incurring significant costs.

Typical Use Cases for Free Mode:

  • Automated Report Summarization: Small businesses can use the AI to generate concise summaries of financial reports, inventory levels, or sales trends.
  • Simple Content Generation: AI can assist in creating basic marketing copy, customer-facing content, or internal memos.
  • Data-driven Alerts: Using AI to provide simple notifications or alerts based on predefined data thresholds within NetSuite.

On-Demand Mode: Explanation and Larger-Scale Usage

On-Demand Mode is tailored for larger, more complex operations that require higher throughput and more advanced AI capabilities. This mode unlocks the full potential of generative AI, allowing businesses to handle larger data sets and more intricate tasks while providing greater control over model parameters and outputs.

Key features of On-Demand Mode:

  • Scalability: On-Demand Mode can handle large volumes of data and multiple concurrent processes, making it suitable for businesses with significant automation or reporting needs.
  • Extended Functionality: Users can access the full suite of AI-powered tools, including advanced data analysis, deep learning models, and customized content generation.
  • Priority Access: Businesses using On-Demand Mode often receive higher priority processing speeds and fewer restrictions on API usage, ensuring that complex operations run smoothly without delays.

Typical Use Cases for On-Demand Mode:

  • Advanced Data Analytics: Enterprises can use AI to process vast amounts of operational data, uncovering insights that drive strategic decision-making and improve efficiency.
  • Comprehensive Content Generation: On-Demand Mode can assist with generating large volumes of personalized content for marketing, customer service responses, or product descriptions.
  • In-depth Customer Insights: By analyzing customer behavior and trends, businesses can use AI to predict future purchasing patterns, optimize pricing strategies, and create tailored product recommendations.

With On-Demand Mode, businesses can fully integrate generative AI into their daily operations, unlocking greater efficiencies and capabilities across their NetSuite platform. Whether for strategic initiatives, customer engagement, or operational optimization, this mode empowers businesses to scale AI adoption in line with their evolving needs.

Use Cases:

The integration of SuiteScript 2.1 and generative AI within NetSuite opens up numerous possibilities for automating tasks, enhancing decision-making, and improving business efficiency. Here are some practical use cases where these capabilities can deliver significant value to businesses:

Automated Report Summarization

One of the key strengths of generative AI within NetSuite is its ability to automate report summarization. Businesses often deal with large, complex reports that can be time-consuming to analyze manually. With AI integration, NetSuite can automatically generate concise summaries of key performance indicators (KPIs), financial reports, inventory status, or sales trends, allowing decision-makers to quickly grasp the most important insights.

Data-Driven Insights

Generative AI can help businesses unlock valuable insights from their data, enabling smarter, more informed decision-making. By analyzing historical data, transactional records, or real-time business metrics, AI models can generate actionable recommendations, predict future trends, and identify potential areas for improvement.

Additionally, AI can assist in forecasting demand by analyzing historical sales data, seasonal trends, and market conditions. This allows businesses to proactively adjust inventory levels, production schedules, and marketing strategies.

Content Generation

Generative AI offers powerful content creation capabilities, which can be a game-changer for businesses that need to generate large volumes of text. Whether it’s for marketing campaigns, customer communications, or product descriptions, AI can automate content generation to maintain consistent messaging and save time.

These practical applications of SuiteScript 2.1 and generative AI can significantly enhance business processes, streamline operations, and unlock new opportunities for growth and innovation. As AI technology continues to evolve, the potential for even more advanced and customized use cases will expand, further transforming how businesses manage their data and operations.

Conclusion

Integrating SuiteScript 2.1 with generative AI in NetSuite offers businesses the opportunity to automate processes, generate actionable insights, and enhance productivity. This powerful combination streamlines workflows, improves decision-making, and allows for scalable personalization. As AI continues to evolve, businesses can expect even more transformative solutions to optimize their operations and customer experience.

Read More: Artificial Intelligence (AI) in NetSuite

Our Blogs

Get In Touch

Our customer support team is available for help.

Let's Talk Business!