SAP Knowledge Base Article - Public

3753301 - Context Variable returns None in script workbench after parallel quoting is enabled

Symptom

When testing a script in Script Workbench, Context variable is returning None when opening workbench without a quote in session. 

Environment

SAP CPQ

Reproducing the Issue

  1. Open Script Workbench
  2. Open the Quote
  3. Attempt to retrieve context using a = Quote.Context
  4. Variable Returns None.

Cause

Expected behavior.

Resolution

  • When parallel quoting is active, there are two scenarios when opening Script Workbench:
    • The quote has already been created and quote is in session (User is on the page of the quote)
      • When opening ScriptWorkbench, quoteId parameter is passed to the URL
      • Scripting object context.Quote will reference the corresponding quote sent to URL
    • No quote exists in the session
      • context.Quote object in the scripting will be none
  • In case customizations have been made to the UI template, adjustments are required in order to properly work. From CPQ-2605 default code has been updated 
    <a id="ScriptWorkbenchId" data-bind="attr: { href: scriptWorkbenchHref }" target="_blank" rel="noopener noreferrer">
    <span class="invisible-when-menu-expanded">&#xe22d;</span>&nbsp;@Translation.Get("Menu.ScriptWorkbench")
    </a>
    • scriptWorkbenchHref is mandatory to Script Workbench open with QuoteID in the URL and context be retrieved in it. 

Keywords

Parallel Quoting, Parallel Quote, Multiple User, Context, Scripting, CPQ , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , How To

Product

SAP CPQ 2024