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. 

ナレッジ記事番号

005465390

 
読み込み中
Salesforce Help | Article