Error Message in Generate Document: Attempt to de-reference a null object

This error. Is the worst. It appears everywhere and indicates no detail about why the error happens. WTF. This will be a thread of reasons why this could happen. The first reason is below.

Block Pricing Product without Blocks!

Whaaaaaat. It turns out if you have a block priced product without block prices, you get this error.

Pricing Method: Block
Block Pricing Field: Quantity
Block Prices: None!
Generate Document: Attempt to de-reference a null object

The actual cause of the error is having a lines section trying to display a line with null values for all of the calculated fields. Which happens if you have a block priced product with no block prices.

Pricing Information: Null Values

Another one!

Over-formatting of merged text, text-area, or rich text fields. If a user pastes from Word (or similar) and includes a table (or similar), it will cause this error when rendering Quote Document. Solution: Review the values of any merged, text-area, or rich text fields referenced in your Quote Template. You can do this easily by extracting the data with Data Loader and reviewing the output CSV for any crazy HTML formatting. Remove it and do an update with Data Loader!

There you have it. I’ll add to this post if and when I find another one of these. 👍🏻 ✌🏻

One thought on “Error Message in Generate Document: Attempt to de-reference a null object

  1. I have another one for this…

    Over-formatting of merged text, text-area, or rich text fields. If a user pastes from Word (or similar) and includes a table (or similar), it will cause this error when rendering Quote Document. Solution is to clear formatting.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.