Loading
Slack 관련 문의처가 Salesforce Help로 통합 및 변경됩니다.더 많이 읽기

Salesforce CPQ (Managed Package): 'Attempt to de-reference null object' error on Amend of dataloaded MDQ Subscriptions

게시 일자: Oct 26, 2026
상세 설명

In certain circumstances, pressing 'Amend' on a Contract to load the Salesforce CPQ Amend Visualforce page will return 'Attempt to de-reference null object' error if MDQ subscription data has been dataloaded in such a way that subsequent revised segments are created before their earlier segments.

Package logic:
During amendment when Subscription data is loaded it first has an order by clause added to it for CreatedDate ASC, and then an additional clause for Name ASC is added.

Later on when setting the segment quantities CPQ processes the subscriptions in order from the query results. It stores a reference to them in a map because later on the logic checks if a Subscription has a value for RevisedSubscription, is so the package looks up that Subscription from the map and get the quantity. If that sub hasn't been processed yet it will cause an NPE.

Hitting an Attempt to de-reference null object error only happens when:

    • A Subscription has RevisedSubscription__c populated (pointing to its original)
    • That revised Subscription has SegmentQuantity__c != null (true for all MDQ segments)
    • The revised Subscription is iterated BEFORE its original in the list
솔루션

To handle the aggregation appropriately, the revised mdq Subscriptions should be loaded in stages / separate batches.

For example: first load the original Subscription data. Then 1st amendment revision Subscription data. Then 2nd amendment revision data. 

Knowledge 기사 번호

005465390

 
로드 중
Salesforce Help | Article