Symptom
- When using the Product object in the Pre Action of the Add Item action in SAP CPQ new quote engine, script execution fails with an error similar to:"System.MissingMemberException: 'NoneType' object has no attribute 'PartNumber'".
- The issue occurs even though the same script may execute successfully in Script Workbench.
Environment
SAP CPQ
Reproducing the Issue
- Create a Custom Action containing a script that references the Product object, for example: k = Product.PartNumber.
- Assign the Custom Action as a Pre Action under: Workflow > My Quotes > Open-Open > Add Item
- Open a quote and add or configure a product.
- Trigger the Add Item action.
- Observe that script execution fails with a NoneType error for the Product object.
Cause
- In the SAP CPQ Q2.0 engine, the Product object is not supported in the Pre Action context of the Add Item action.
- As a result, the Product variable is not initialized during execution of the Pre Action script, causing NoneType errors when attempting to access Product properties such as PartNumber.
Resolution
- Do not use the Product object in the Pre Action of the Add Item action in the Q2.0 engine.
- For these use cases, use the product-level event: 'On Before Add To Quote' instead of the Add Item Pre Action.
- If support for the Product object in this context is required, submit the requirement through the appropriate SAP enhancement request process.
Keywords
SAP CPQ, new quote engine, Q2.0, Add Item pre action, Product object, Product.PartNumber, NoneType object has no attribute PartNumber, AttributeError, System.MissingMemberException, custom action, On Before Add To Quote, scripting, IronPython, Product variable null, preaction script failure, Add Item workflow, CPQScriptEngine , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Problem
Product
SAP CPQ all versions
SAP Knowledge Base Article - Public