Overview
A Null Pointer Exception can occur when a user clicks the Annual Statement button on a Contact record (or when related functionality is executed), and the system needs to access Organization fiscal information.
This issue typically affects users who do not have the "View Setup and Configuration" system permission enabled on their profile. Without this permission, Salesforce restricts access to Organization-level settings, causing the process to fail.
How We Resolved the Issue
To prevent this error, a new Organization Fiscal Settings Custom Setting has been introduced.
Instead of retrieving fiscal year information directly from the Organization object, the application can now use values stored in the custom setting. This allows users to generate Annual Statements successfully even when they do not have access to Organization setup data.
Who Needs to Take Action?
- System Administrators must create and maintain the Organization Fiscal Settings record.
- End users do not need to perform any action.
Note: The custom setting is included in the Payments2US package/profiles, but the record must be configured with your organization's fiscal information.
How to Configure the Organization Fiscal Settings
Step 1: Get Organization ID and Fiscal Year Information
- Go to Setup.
- Search for Company Information in the Quick Find box and copy the details circled in blue

Step 2: Open Custom Settings
- Go to Setup.
- Search for Custom Settings in the Quick Find box.
- Open Organization Fiscal Settings.
- Click Manage.

Step 3: Create the Record
- Click New.
- Enter the record Name as Default.
- Populate the following fields:
- Organization ID - Your Salesforce Organization ID.
- Fiscal Year Month - The month in which your fiscal year starts.
- Use Start Date As Fiscal Year Name - Select according to your organization's fiscal year configuration.
Step 4: Save
- Click Save.
- Verify that the record appears in the list of Organization Fiscal Settings records.

Expected Result
Once the Default Organization Fiscal Settings record is created and saved:
- Users can successfully generate Annual Statements.
- The system can retrieve fiscal year information without requiring access to the Organization object.
- The Null Pointer Exception is prevented for users who do not have the View Setup and Configuration permission.
Troubleshooting
If the error still occurs:
- Confirm that a Default record exists in Organization Fiscal Settings.
- Verify that all required fields are populated correctly.
- Ensure the fiscal year values match your organization's Salesforce configuration.
- Contact your Salesforce Administrator if the issue persists.