Error Message in QLE: Attempt to de-reference a null object

This message is the worst. Very sorry that you’ve found this error. This is telling you, ”something bad happened in CPQ and we’re not telling you what It is”. This is going to be a living document that contains reasons why you might encounter this error.

  1. Upon upgrading to CPQ 222, when clicking the wrench to enter bundle re-configuration from the Quote Line Editor, an error occurs: “Attempt to de-reference a null object”. 

    Why this happens
    This error occurs if there are product options in the bundle which have products with SBQQ__HasConfigurationAttributes__c set to TRUE but the products do not have any Configuration Attributes.

    The fix
    Set the SBQQ__HasConfigurationAttributes__c field to FALSE on all products that do not have configuration attributes. 

    Running the following code in anonymous apex will print out all the products in the org which have SBQQ__HasConfigurationAttributes__c incorrectly set to true in your org: 

    List<Product2> prodList = [SELECT ID FROM Product2 WHERE SBQQ__HasConfigurationAttributes__c = TRUE]; 
    Set<Id> prodIdSet = new Set<Id>(); 
    for(Product2 prod:prodList){ 
    prodIdSet.add(prod.Id); 

    List<SBQQ__ConfigurationAttribute__c> caList = [SELECT Id, SBQQ__Product__c FROM SBQQ__ConfigurationAttribute__c]; 
    Set<Id> caProdIdSet = new Set<Id>(); 
    for(SBQQ__ConfigurationAttribute__c ca:caList){ 
    caProdIdSet.add(ca.SBQQ__Product__c); 

    Set<Id> prodIdSetCopy = prodIdSet; 
    prodIdSetCopy.removeAll(caProdIdSet); 
    for(Id prodId:prodIdSetCopy){ 
    system.debug(prodId); 
    }
    Reference: https://success.salesforce.com/issues_view?id=a1p3A0000003em4QAA&title=cpq-222-error-attempt-to-de-reference-a-null-object-when-entering-bundle-re-configuration

D P

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.