Implementing Client-Side and Server-Side Actions

Note:

If you do not modify actions, they will no longer work with future NetSuite CPQ Configurator versions.

Complete the following steps to implement client-side and server-side actions:

  1. In your sandbox account, verify that products and actions work as expected with the latest NetSuite CPQ Configurator version. For more information, see Verify the Compatibility with Client-Side and Server-Side Actions.

  2. Separate non-working actions into client-side and server-side. For more information, see Separating Actions into Client-Side and Server-Side.

  3. Separate client-side and server-side functions in different common actions. For more information, see Separating Client-Side and Server-Side Functions in Common Actions.

  4. Update custom event handlers attached to user interface elements and CPQ modules directly calling server-side functions. For more information, see Calling Actions from Event Handlers Attached to User Interface Elements and Calling Actions from CPQ Modules.

  5. If products work as expected after implementing client-side and server-side actions, apply the changes to your production account with the latest version. For more information, see Applying Changes to Production Accounts.

Verify the Compatibility with Client-Side and Server-Side Actions

In your sandbox account, verify that your implementations are compatible with client-side and server-side actions.

To verify the compatibility with the new action types:

  1. In you sandbox account, create a copy of the existing products:

    1. Go to the options record at CPQ > Configurator > Settings.

    2. Export the products to your computer.

    3. Import the products back into your sandbox account.

    For more information about exporting and importing products, see Exporting and Importing Products.

  2. On the product record, check the Block database functions in client-side actions box.

    This option prevents functions that read and write data to the database from working on the client.

  3. Verify that products and actions continue to work as expected. You should test the products in a way that matches typical end-to-end scenarios in your business. These scenarios may include:

    1. Launching the product from a transaction or a website.

    2. Configuring all aspects of a product.

    3. Saving the configured product to a transaction or the shopping cart.

Separating Actions into Client-Side and Server-Side

If products and actions do not work as expected with the latest NetSuite CPQ Configurator version, you must separate actions into client-side and server-side. For more information about specific use cases, see Code Examples.

To separate actions into client-side and server-side:

  1. Go to the Actions subtab on the product record:

    • Click Edit to modify actions.

    • Click New CPQC Action to create actions.

  2. Create or edit actions as required to obtain client-side or server side actions. For more information see Using Different Action Types and Customizing Products with Scripts Using Action Records and Functions.

  3. In client-side actions, store:

    • Client-side functions.

      For more information, see List of Functions.

    • Asynchronous functions in JavaScript ES6.

  4. In server-side actions:

    • Store server-side functions.

    • Check the Run on server box.

  5. Decide how to establish the communication between client and server. For more information, see Establishing Client-Server Communication.

  6. Rearrange sequence numbers so that the actions run in the correct order.

  7. Verify that products continue to work as expected.

  8. If products continue to work as expected, export the new product versions from the options record.

  9. On the options record, import the new production versions back into the old product versions using the Target Product field.

    This step aims to preserve the product ID.

    For more information, see Exporting and Importing Products.

Separating Client-Side and Server-Side Functions in Common Actions

Common actions derive their type from the type of the action to which they are linked. Common actions linked to server-side actions can only include server-side functions, while common actions linked to client-side actions can only include client-side functions.

To work with client-side and server side functions in common actions:

  1. Go to CPQ > Configurator > Common Actions.

    • Click Edit next to a common action to modify it.

    • Click New CPQC Common Action to create a common action.

  2. Separate client-side and server-side functions in different common actions. Create new common actions when necessary. For more information, see Code Examples.

  3. Decide how to establish the communication between client and server. For more information, see Establishing Client-Server Communication.

  4. Modify the actions linked to common actions to be a server-side or a client-side action. For more information, see Separating Actions into Client-Side and Server-Side.

  5. Create new client-side or server-side actions to link to the new common actions.

Common actions are automatically included in the product export.

Related Topics

Applying Changes to Production Accounts

If products work as expected after implementing client-side and server-side actions, apply the changes to your production account with the latest version.

To apply changes to your production account:

  1. In your sandbox account, go to the options record at CPQ > Configurator > Settings.

  2. Export products with client-side and server-side actions to your computer.

  3. In your production account, go to the options record.

  4. Import new products into the original products using the Target Product field.

For more information about exporting and importing products, see Exporting and Importing Products.

General Notices