SAP Knowledge Base Article - Public

3584737 - Error message when trying to get non existing item through function GetItemByItemId

Symptom

You are receiving the generic error message ("Object reference not set to an instance of an object.") when using the scripting method context.Quote.GetItemByItemId(). You would like for this call to return a Null / None Value for an item that does not exist.

Environment

SAP SALES CLOUD CPQ

Reproducing the Issue

  • Open Script Workbench.
  • Call context.Quote.GetItemByItemId(#) -> replace # with Non existent Item ID e.g. 123456789.

Cause

This is a bug in CPQ.

Resolution

Expected to be resolved as part of 2505.

Keywords

itemID, quote, context, GetItemByItemId, scripting, Bug, Known Error, scripting, code, correction , KBA , CEC-SAL-CPQ , Sales Cloud CPQ , Known Error

Product

SAP CPQ 2025