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
- Open Script Workbench
- Open the Quote
- Attempt to retrieve context using a = Quote.Context
- 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
- The quote has already been created and quote is in session (User is on the page of the quote)
- 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"></span> @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
SAP Knowledge Base Article - Public