Quick Opportunity LWC for NPSP: Streamline Donation Entry in Salesforce Non-Profit Success Pack

Learn about the new open-source Lightning Web Component that helps nonprofit organizations quickly enter Opportunities (donations) in Salesforce NPSP. This powerful tool focuses on key fields and includes type-ahead functionality for efficient data entry.

  • 7 min read
Lightning Web Components NPSP Non-Profit Success Pack Salesforce Development Open Source Donation Management Fundraising Salesforce Customization

Quick Opportunity LWC for NPSP: Streamline Donation Entry in Salesforce Non-Profit Success Pack

Introduction: The Challenge of Quick Donation Entry

If you’ve ever worked with Salesforce Non-Profit Success Pack (NPSP) and found yourself spending too much time entering donations (Opportunities), you’re not alone. The standard Salesforce Opportunity entry process can be cumbersome when you need to quickly record multiple donations, especially during busy fundraising periods or when processing batch donations.

Enter Quick Opportunity LWC for NPSP, a new open-source Lightning Web Component that streamlines the donation entry process. This powerful tool lets nonprofit organizations focus on the key fields needed for donation entry, with built-in type-ahead functionality and support for entering multiple donations at once.

What is Quick Opportunity LWC for NPSP?

Quick Opportunity LWC for NPSP is a Lightning Web Component designed specifically for nonprofit organizations using Salesforce Non-Profit Success Pack. Created for The Henzi Foundation and now available as open-source software, this component simplifies the process of entering Opportunities (donations) in Salesforce.

Key Features:

  • Quick Entry Interface: Focus on essential fields without navigating through multiple screens
  • Multiple Donation Entry: Enter one or many donations in a single session
  • Type-Ahead Search: Built-in type-ahead functionality for contacts and campaigns
  • Inline Contact Creation: Create new contacts on the fly without leaving the component
  • NPSP Integration: Seamlessly integrates with NPSP’s household account management
  • Custom Field Support: Includes support for custom fields like Funding Source
  • Keyboard Navigation: Efficient keyboard navigation for power users
  • Real-Time Validation: Immediate feedback on data entry errors

The Problem It Solves

Traditional Salesforce Opportunity entry requires users to:

  1. Navigate to the Opportunity object
  2. Click “New” and fill out a lengthy form
  3. Search for and select a Contact or Account
  4. Navigate through multiple fields, many of which may not be relevant for quick donation entry
  5. Repeat this process for each donation

This workflow becomes particularly challenging when:

  • Processing multiple donations from an event
  • Entering batch donations from a fundraising campaign
  • Recording donations during peak fundraising periods
  • Working with volunteers or staff who need a simplified interface

The Quick Opportunity LWC Solution

With Quick Opportunity LWC for NPSP, you get:

  • Streamlined Interface: A table-based interface optimized for quick data entry
  • Bulk Entry: Add multiple donation rows and save them all at once
  • Smart Search: Type-ahead search for contacts and campaigns reduces data entry time
  • Context-Aware: Can be deployed as a utility bar item, always accessible without taking up full page space
  • Focus on Essentials: Only the most important fields are displayed, reducing cognitive load

Installation and Setup

Quick Opportunity LWC for NPSP is available as open-source software on GitHub. Here’s how to get started:

Prerequisites

Before you begin, ensure you have:

  • Salesforce CLI installed
  • Node.js and npm installed
  • VS Code with Salesforce Extensions installed
  • Salesforce org with NPSP installed (or adapt for standard Salesforce)

Installation Steps

1. Clone the Repository

git clone https://github.com/JHenzi/Quick-Opportunity-LWC-NPSP.git
cd Quick-Opportunity-LWC-NPSP

2. Install Dependencies

npm install

3. Authenticate with Your Salesforce Org

sf org login web -d -a myorg

4. Deploy to Your Org

sf project deploy start

5. Assign Permissions

Ensure users have appropriate permissions to:

  • Create Opportunities
  • Create Contacts (if using inline contact creation)
  • Access Campaigns
  • Use the Lightning Web Component

Configuration and Customization

One of the strengths of Quick Opportunity LWC for NPSP is its flexibility. The component can be customized for your organization’s specific needs.

Basic Configuration

The component focuses on these key fields by default:

  • Contact: The donor (with type-ahead search)
  • Campaign: The fundraising campaign (with type-ahead search)
  • Amount: The donation amount
  • Close Date: When the donation was received
  • Stage: Opportunity stage (typically “Closed Won” for donations)
  • Funding Source: Custom field for tracking donation sources

Customization Options

1. Change Terminology

If your organization uses different terminology (e.g., “Donor” instead of “Contact”), you can update:

  • Component labels in the HTML template
  • Apex controller method names and comments
  • CSS class names

2. Add Additional Fields

Common additions include:

  • Lead Source
  • Probability
  • Type
  • Custom fields specific to your organization

3. Deploy as Utility Bar Item

For maximum accessibility, deploy the component as a utility bar item:

  1. Setup → App Manager → Edit your app
  2. Utility Items → Add Utility Item
  3. Select donationEntry component
  4. Configure size (recommended: 400px width, 600px height)

This allows users to access the component from any page without navigating away.

4. Remove NPSP Dependencies (For Non-Nonprofit Orgs)

If you’re not using NPSP, you can adapt the component for standard Salesforce:

  • Remove NPSP field references
  • Update Account handling for B2B or B2C scenarios
  • Modify test classes accordingly

Technical Architecture

Quick Opportunity LWC for NPSP is built following Salesforce best practices:

Component Structure

  • Lightning Web Component (LWC): Modern, performant component built with LWC framework
  • Apex Controller: DonationEntryController handles server-side logic
  • Test Coverage: Comprehensive test class (DonationEntryControllerTest) with high coverage
  • Security: Built with with sharing to enforce org-level sharing rules

Security Features

SOQL Injection Protection: All user inputs are properly escaped using String.escapeSingleQuotes()

Sharing Model: Controller uses with sharing to enforce org-level sharing rules

Input Validation: All required fields are validated before database operations

Error Handling: Comprehensive try-catch blocks with user-friendly error messages

Code Quality

Test Coverage: Comprehensive test class covering:

  • Contact search and creation
  • Campaign search
  • Opportunity creation (single and multiple)
  • Validation error handling
  • Edge cases (empty lists, null values, invalid data)

Error Messages: Clear, actionable error messages for users

Code Comments: Well-documented code with clear explanations of NPSP integration points

Performance: Efficient SOQL queries with appropriate limits and selective field queries

Use Cases

Quick Opportunity LWC for NPSP excels in several scenarios:

1. Event Donation Entry

After a fundraising event, quickly enter all donations received:

  • Multiple donations from different donors
  • All associated with the same campaign
  • Batch processing saves significant time

2. Monthly Donation Processing

Process recurring monthly donations efficiently:

  • Use type-ahead to quickly find existing donors
  • Enter multiple donations in one session
  • Maintain consistency in data entry

3. Volunteer-Friendly Interface

Provide volunteers with a simplified interface:

  • Focus on essential fields only
  • Reduce training time
  • Minimize data entry errors

4. Mobile Donation Entry

While optimized for desktop, the component can be adapted for mobile:

  • Touch-friendly targets
  • Responsive layout considerations
  • Offline capability potential

Best Practices

When implementing Quick Opportunity LWC for NPSP, consider these best practices:

  1. User Training: Provide brief training on the new interface, especially for users familiar with standard Opportunity entry
  2. Data Validation: Leverage the built-in validation, but also consider adding org-level validation rules
  3. Permission Management: Ensure users have appropriate permissions without over-provisioning
  4. Testing: Test thoroughly in a sandbox before deploying to production
  5. Customization: Adapt the component to match your organization’s specific needs and terminology

About The Henzi Foundation

This component was originally created for The Henzi Foundation (henzi.org), a nonprofit organization that helps families who have experienced the unexpected loss of a child. The foundation’s Frankie Fund provides financial assistance for funeral expenses, allowing grieving families to focus on healing without financial stress.

The component was developed by Joe Henzi, a Salesforce professional with over 10 years of experience, to streamline the foundation’s donation entry workflow.

Contributing and Support

Since Quick Opportunity LWC for NPSP is open-source, you can:

  1. Fork the Repository: https://github.com/JHenzi/Quick-Opportunity-LWC-NPSP
  2. Customize for Your Org: Adapt the code to meet your specific needs
  3. Contribute Improvements: Submit pull requests to share enhancements with the community
  4. Report Issues: Open issues on GitHub for bugs or feature requests

License

This project is licensed under the GPL-3.0 license, making it free to use and adapt for your nonprofit organization’s Salesforce instance.

Conclusion: Streamline Your Donation Entry Process

Quick Opportunity LWC for NPSP solves a real problem faced by many nonprofit organizations: how to quickly and efficiently enter donations in Salesforce without getting bogged down in lengthy forms and multiple navigation steps.

Key takeaways:

  • Open Source: Free to use and adapt for your organization
  • NPSP Optimized: Built specifically for Non-Profit Success Pack
  • User-Friendly: Streamlined interface focused on essential fields
  • Secure: Built with security best practices
  • Well-Tested: Comprehensive test coverage
  • Flexible: Highly customizable for your specific needs

Whether you’re a nonprofit administrator looking to streamline donation entry or a Salesforce developer wanting to contribute to an open-source project, Quick Opportunity LWC for NPSP is worth exploring. It’s a practical solution that can save significant time during busy fundraising periods.

Resources


Ready to streamline your donation entry process? Check out Quick Opportunity LWC for NPSP on GitHub and start saving time on donation entry today. It’s free, open-source, and designed specifically for nonprofit organizations using Salesforce NPSP.