The Problem
I guess that since you are reading this article you’re looking for the solution for the error in the title of the post: Calculation error on quote Q-00161: “UNAUTHORIZED”.

I guess that since you are reading this article you’re looking for the solution for the error in the title of the post: Calculation error on quote Q-00161: “UNAUTHORIZED”.
The Start Date and End Date of your Contract or Subscription records are not aligned (not equal) to the Start Date and End Date of your Quote or Quote Line.
Example, your quote may look like this
Start Date | End Date | |
Quote Line 1 | 09.02.2021 | 31.12.2021 |
And your subscription looks like this:
Start Date | End Date | |
Subscription 1 | 09.02.2021 | 08.02.2022 |
And that’s how you want to have your Subscription
Start Date | End Date | |
Subscription 1 | 09.02.2021 | 31.12.2021 |
There is a way how to solve that.
You want to mask/obfuscate the data on sandbox created for CPQ implementation or UAT. This is in order to provide the security for the data. Within the GDPR regulations in place, having this extra security precaution is helpful.
As you probably know, Salesforce releases new versions of its software on a regular basis. New releases enable new features in the orgs and sometimes you just need those features to deliver your project.
The information about the org version is not included in the Company Information section of your SF org. There are a few steps needed to get this information.
In Salesforce CPQ, you need to sort Quote Lines in the Quote Line Editor, in a custom way, automatically. You want it to happen without user action, always. In this example, we will assume that there are 2 products that always need to be at the bottom of the screen, below any other product in the QLE.
While trying to preview or generate Quote Document, as a non-admin user, you observed that the pick list for the template selection is empty, like the one below:
or you have some options there, but the one you are looking for is not visible.
In Salesforce CPQ, you might sometimes see an error message
Attempt to de-reference a null object
like shown in the image below:
while generating a Quote document from your Quote Template.
You need an Effective End Date on the Quote Line, that will never be blank and will contain the end date of the subscription for a given line.
The problem with the
SBQQ__EffectiveEndDate__c
field is that it’s empty when the subscription term is used and not the end date.
In Salesforce CPQ, Calculate ACV (Annual Contract Value) for the first year of all subscription products on the Quote, for both: MDQ and non-MDQ products. All subscription products belong to a Product Family of Subscription. All MDQ products in the catalog has Price Dimension set to a Year, Subscription Term is set to 12, and Subscription Term Unit set to Months.
In order to calculate an the ACV, you have to crate 2 Custom Fields: