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:
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

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.