Netsuite Integration With SAP CPQ

To integrate Netsuite with SAP CPQ, follow next steps.

Step 1: Log in

Step 2: Create a new script

  • Download CPQSSOSuitelet.js JavaScript file from the following link (.js file is zipped): cpqssosuitelet.zip
  • Unzip the file on your computer.
  • At the top menu go to CustomizationScriptingScriptsNew (See Figure 1).

Figure 1


  • On the next screen (See Figure 2), click on “plus” button. Note that this button appears if you hover your mouse pointer over the text field.

Figure 2


  • In the pop up window (See Figure 2.1), fill in text fields as follows:
    • Attach from: Computer
    • File Name: CPQSSOSuitelet.js
    • Folder: SuiteApps


Figure 2.1


  • Pick the CPQSSOSuitelet.js file you saved on your computer in previous step
  • Click Save button. This will close the pop up
  • On the next screen (See Figure 2.2) click on Create Script Record button


Figure 2.2


  • Pick a script type on the next screen (See Figure 2.3)


Figure 2.3


  • Enter the the name in the Name text-entry field (See Figure 2.4). You don't need to populate the field ID because it will be populated by default later.
  • Populate the Function field in the Scripts tab with the following: buildSuitelet.


Figure 2.4


*Click Save.

Script details screen is displayed (See Figure 2.5).

Figure 2.5


Step 3: Deploy script

  • Click Deploy Script - (See Figure 2.5). Script deployment page is displayed.
  • Populate the following fields:
    • Status - Released
    • Log level - Error


Figure 3
  • Click Save.



Details screen is displayed (See Figure 3.1)


Figure 3.1

Once you fill out the form, write down the number from the URL field found on the page following the script argument (Figure 3.1). You will need this number later.

Step 4: Edit Script File



  • Go to CustomizationsScriptingScripts, find your script and click on view link (See Figure 4)

Figure 4


Script details page is displayed (Figure 4.1)

  • Click on edit beside script file name

Figure 4.1


  • In CPQSSOSuitelet.js file update the value for the variable suiteletId with the value you wrote down in Step 3. (See Figure 4.2).
  • In step 6, you will create SSO integration. Once you create it, you should update this line of code in CPQSSOSuitelet.js file
var url = nlapiOutboundSSO('customsso1');

with this code

var url = nlapiOutboundSSO('YourIntegrationID');

YourIntegrationID is the ID assigned to SSO Integration you will create in step 6

Figure 4.2

Step 5: Create opportunity form

  • Go to TransactionSalesCreate Opportunities (See Figure 5.1)

Figure 5.1


  • On the same page, at the top right corner click on CustomizeCustomize Form link (See Figure 5.2).


Figure 5.2


  • Under the Tabs tab, populate the form as depicted on figure 5.3

Figure 5.3


  • Download OpportunityInit.js file from the following link (.js file iz zipped): opportunityinit.zip
  • Unzip file on your computer
  • Click the Custom Code tab, and upload script file OpportunityInit.js (See Step 2 for details)
  • Type OpportunityInit.js as file name
  • When file is uploaded, click the Open icon on the right-hand side (See Figure 5.4).

Figure 5.4


  • At the screen that opens, click Edit for OpportunityInit.js (See Figure 5.5).

Figure 5.5


  • Change functions NewQuote and ViewQuote so that the number located in their variables URL, following the argument script, is the same number you wrote in Step 3 (See Figure 5.6). Click Save button.

Figure 5.6
  • Return to the Custom Code tab and, in the Page Init Function field enter initFunction (See Figure 5.7).

Figure 5.7


  • Go to Action tabCustom Actions to add two custom actions: New CPQ Quote and View CPQ Quote. Functions that will be mapped to these two actions are defined in OpportunityInit.js that you uploaded earlier.
  • Click Add to add row
  • Enter LABEL text, FUNCTION name, and DISPLAY AS, as depicted in figure 5.8
  • Once you complete steps for both functions, click Save

Figure 5.8

Step 6: Create integration with SAP CPQ

Go to SetupIntegrationSuiteSignOnNew (See Figure 6.1).

Figure 6.1

Once the page opens, fill the form out with the appropriate data. (See Figure 6.2)
Note that a Shared Secret key is defined by you, and you use it on SAP CPQ side as well.

  • Under Connection Points tab, you define SAP CPQ integration URL and integration variables. Enter your SAP CPQ domain name in the form domain=Your_CPQ_domain_name as depicted in figure 6.2 (we used alldemos2_leading domain name in the example).

ID that is assigned to your newly created Single Sign On must be inserted into CPQSSOSuitelet.js file as described in Step 4.

Figure 6.2
  • Under User Identification tab, tick two checkboxes - account and email and click on Save button (See figure 6.3).

Figure 6.3

Write down your Consumer Key and Shared Secret because you will need them later.

Step 7: Integration setup on SAP CPQ side

  • Go to SAP CPQ SetupCRM IntegartionGeneral (See Figure 7.1).
  • Choose NetSuite from the SAP CPQ is integrated with drop-down menu.
  • Fill out NetSuite SingeSignOn url field with the appropriate value.

NetSuite Single SignOn URL for the NetSuite development environment:

https://system.na1.netsuite.com/app/common/integration/ssoapplistener.nl

NetSuite Single SignOn URL for the NetSuite production environment:

https://system.netsuite.com/app/common/integration/ssoapplistener.nl

Figure 7.1
  • Fill out NetSuite Consumer Key and Netsuite shared Secret fields with the values you noted in the previous step.


Now you will have to add an administrative account. To do so, follow these steps.

  • Go to SetupCRM IntegrationCRM Administrator Account (Figure 7.2).
  • Click Add New to create a new administrator account.

Choose NetSuite as the CRM Name, then fill out other fields based on your data and needs and click Save.

Figure 7.2


The next step is to create a custom action in order to update NetSuite opportunity with SAP CPQ data.

To create new Custom Action, follow next steps.

  • Go to SetupDevelopCustom Actions, then click on Add New button.
  • Fill out fields (Action Name, Placement, Scripting Code, Script) as depicted in Figure 7.3.
  • Download updateNetsuite.py Script from the following link (.py file is zipped): updatenetsuite.zip
  • Unzip the file on your computer, copy script text and paste Custom Action Script text field.


Figure 7.3

Set Workflow Permissions and Workflow Actions for this Action on the appropriate Setup page. For more information on how to set this, visit appropriate help pages:


Customer Mappings

Now, you should write a script for Customer Mappings or you can use the script attached below.
To define Customer Mappings Script

  • go to SetupDevelopGlobal Scripts and add a new Script.
  • On tab Script give script a name (for example CustomerMappings).
  • Download Script from the following link (.py file iz zipped): customermappings.zip
  • Unzip file on your computer, copy script text and fill out the appropriate text field (as depicted on Figure 7.4).
  • On tab Event, mark that the Script should execute on onCustomerMappings event.

Figure 7.4


Note that Integration is 100% customizable – you must write your own scripts based on business needs or use scripts listed on this page, otherwise, Integration will not work.

Custom Field Mappings

Now, you should write a script for Custom Field Mappings or you can use the script attached below.

  • go to SetupDevelopGlobal Scripts and click on Add New button.
  • On Script tab, define a script name (e.g. CustomFieldsMappings).
  • Download script from the following link (.py file iz zipped): customfieldsmappings.zip
  • Unzip file on your computer, copy script text and paste into the script text field.
  • On Events tab, define that this script should execute on arriving from CRM and On Quote Fields Mappings event. (See Figure 7.5). Click Save.

Figure 7.5

Each of these scripts must be attached to an adequate Arrive From CRM event. Additional mappings (opportunity statuses, countries…) should be defined in SAP CPQ custom tables. Examples of defining such custom tables can be found in excel files, “NSTOCPQCOUNTRYMAPPING” and “OpportunityStatusMapping”. Examples of using them can be found in “UpdateNetSuite” and “CustomersMapping” scripts.


Sample custom tables for country and opportunity status mappings can be downloaded from the following locations:

Send document to Netsuite

In order to be able to send document SAP CPQ to Netsuite, you should write an Iron Python script and attach it to the custom action that you previously defined as well. Follow next step do implement this feature.

  • Go to SetupDevelopCustom Actions and click on Add New button. (See figure 7.6)

Figure 7.6
  • Fill out the fields on the displayed form with the appropriate data.
  • Download Custom Iron Python script from this link (.py file is zipped): senddoctonetsuite.zip. Unzip the file, copy script text and paste into the appropriate field. (See figure 7.7)

Figure 7.7 - Define custom action
  • Save custom action

Now, you should set availability and permission for this custom action through Workflow. To find more details on how to set Workflow, visit Workflow Actions and Workflow Permissions help page.

User mappings

Netsuite and SAP CPQ users are mapped the first time you arrive from Netsuite to SAP CPQ (while opening or creating the quote). Only the first time that you arrive from Netsuite, you will be prompted to enter your SAP CPQ username, password and domain name. From that moment, your Netsuite and SAP CPQ users are mapped, and you do not need to enter data again.

That being said, there is no need to do manual mappings neither through SAP CPQ setup nor Netsuite setup.

You are here: CallidusCloud SAP CPQ Online HelpAdmin Page HelpIntegrationsNetsuite Integration With SAP CPQ