Start a conversation

NullPointerException During Master Catalog Publication Due to Invalid Add-On Associations

Symptom

Master catalog publication fails with java.lang.NullPointerException in UAT.

Cause

The master catalog publication process iterates through all Price Item Add-On associations. When an association has a null Add-On Price Item reference, the code encounters a NullPointerException.

This occurs when cspmb__Price_Item_Add_On_Price_Item_Association__c records exist where cspmb__Add_On_Price_Item__c is null.

Resolution

Step 1: Run the diagnostic SOQL query

Run the following SOQL query to find invalid records:

select id, LastModifiedDate
from cspmb__Price_Item_Add_On_Price_Item_Association__c
where cspmb__Add_On_Price_Item__c = null
order by LastModifiedDate desc

Step 2: Review the returned records

The returned records are Add-On Price Item associations that reference a null/missing Add-On Price Item.

Step 3: Fix the invalid records

Either delete the invalid association records or update them to reference a valid cspmb__Add_On_Price_Item__c record.

Step 4: Retry publication

Retry the master catalog publication.

Step 5: Verify success

Verify the publication completes successfully without NullPointerException.

Additional Notes

  • This issue can occur if Add-On Price Items are deleted without first removing their association records
  • Consider adding validation rules on cspmb__Price_Item_Add_On_Price_Item_Association__c to prevent null cspmb__Add_On_Price_Item__c values
  • Run the diagnostic query periodically before publications to catch data integrity issues early
Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Priyanka Bhotika

  2. Posted

Comments