About the Client
The client is a growing enterprise that receives a high volume of invoices and purchase orders by email and through manual uploads. It uses Salesforce as its main CRM for sales operations, customer data and revenue tracking. Before this project, getting document data into Salesforce was largely manual, slow and error-prone.
The Challenge
Getting invoice and purchase order data into Salesforce raised six problems.
Manual Data Entry
Invoice and purchase order details were typed into Salesforce Opportunities by hand.
Transcription Errors
Manual copying created a high risk of mistakes.
No Document Tracking
There was no central way to track inbound documents and their processing status.
Hard to Validate
Checking extracted data against the original document was difficult.
Duplicates and Missing Data
Duplicate invoices and missing account or product information were hard to spot.
Growing Volumes
Manual processing couldn’t scale as document volumes increased.
The result was delayed Opportunity creation, inconsistent data quality and extra administrative work.
The Solution
LST Consultancy built a Salesforce OCR document automation solution using Nanonets OCR, Salesforce Email Services, custom objects and API-based integrations.
Inbound documents
By email or upload
- PO-55018.pdfPO date 03/14Processed
- INV-2207.pdfDuplicate PO no.Flagged
- PO-55020.docxTo PDF via GraphPending
- PO-55021.pdfNew customerAccount
Nanonets OCR + staging workflow
- JSON extract
- Duplicate check
- OAuth 2.0
- Status tracking
Salesforce
Review, confirm, create
- Split-screen reviewPDF beside the form
- OpportunityNamed by PO number
- Product recordsCreated on confirm
- FilesStored by subsidiary
Salesforce and Nanonets OCR Integration
- Inbound documents are sent automatically to Nanonets for OCR processing.
- Extracted data returns to Salesforce in JSON format.
- Communication is secured with API authentication keys and OAuth 2.0.
Staging-Based Document Processing
- A Staging custom object tracks every inbound document.
- A status-driven workflow moves each document through stages: Pending, Processed, Accepted, Rejected, Account Missing, Product Missing and Ready for Process.
- Duplicate detection checks the file name, PO number and PO date.
Split-Screen Review and Validation
- A custom OCR processing page lists every document ready for review.
- A split-screen view shows the original PDF on the left and a pre-filled Salesforce Opportunity form on the right.
- Users can trace and copy text directly from the document into Salesforce fields.
Opportunity and Product Automation
- Opportunities and Product records are created automatically once the user confirms.
- Opportunities follow a standard naming convention based on the PO number.
- Files are stored automatically according to subsidiary configuration.
Configuration, Licensing and AppExchange Readiness
- Central configuration for View, Edit and Create modes.
- Parent and subsidiary support for multi-entity organizations.
- Client and OCR license management with usage tracking.
- Built for deployment through Salesforce AppExchange.
How We Delivered It
We delivered the solution in six phases.
Planning and Requirement Gathering
We defined business objectives, document types, OCR scope and the Salesforce data model.
Solution Design
We designed the integration architecture, staging workflows, the split-screen interface and the security model.
Development
We configured Salesforce Email Services, integrated Nanonets OCR, built the Staging, OCR and License custom objects and the processing interface, and added Microsoft Graph API for document conversion.
Testing
We validated OCR accuracy end to end, along with duplicate handling, error scenarios and performance.
Deployment
We deployed with user training and configuration setup.
Maintenance and Support
We provide ongoing monitoring, enhancements and license management.
Technical highlights
- Salesforce Email Services
- Apex
- Lightning Web Components
- REST APIs with OAuth 2.0
- JSON data exchange
- Microsoft Graph API
- Custom split-screen interface
Obstacles We Overcame
Turning documents into records reliably raised five issues. Here’s how we handled each one.
Data security
- Challenge
- Invoice and order data had to be protected in transit.
- How we solved it
- Secure API authentication and encrypted communication.
Duplicate documents
- Challenge
- The same invoice or PO could arrive more than once.
- How we solved it
- Rule-based matching on PO number, PO date and file name.
OCR accuracy
- Challenge
- Extraction could misread fields on some documents.
- How we solved it
- Validation rules and easy user correction in the review screen.
File format compatibility
- Challenge
- Not every document arrived as a PDF.
- How we solved it
- Automatic conversion of Word and Excel files to PDF.
High document volume
- Challenge
- Volumes kept growing.
- How we solved it
- A scalable, staging-based architecture.
The Results
The product cut manual work sharply and made document data more reliable.
What Changed
- 70–80% less manual entryReduction in manual data entry effort.
- Faster Opportunity creationFrom document receipt to record.
- Higher data accuracyThrough validation and visual review.
- Fewer duplicate recordsThanks to intelligent matching logic.
- More productive usersWith split-screen processing.
- A scalable productAppExchange-ready and able to serve multiple clients.
Key Takeaways

Use a staging layer
Tracking every document through clear statuses makes OCR workflows reliable.
Keep people in the loop
Even with AI-driven extraction, a quick human check is essential.
Design for configuration
Configurable modes and multi-entity support make a solution reusable across clients.
Plan licensing early
Building in license and usage tracking from the start simplifies turning a solution into a product.