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.
- In the Add Products screen, adding a bundle product that has a dynamic feature in it, an error occurs: “Attempt to de-reference a null object”.
Why this happens
You have a filter Product Rule that filters on a field on the Product and forgot to add the stupid field to the Product Option as well. Why does it need to be on the Product Option? 🤷🏼♂️
- 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
Comments