Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OnboardHub

OnboardHub is a Salesforce-native, post-sale customer onboarding / implementation console. It's built entirely on the Salesforce platform — custom schema, bulk-safe Apex triggers with test coverage, Lightning Web Components, declarative automation (Flow), and a Platform Event — as a portfolio companion to an ADM-201 certification.

It also models the real Salesforce side of the SyncBridge integration project: it produces Closed-Won Opportunities and publishes an event the moment onboarding begins, which is the seam an external integration subscribes to.

The story

  1. Sales closes a deal → Opportunity.StageName = 'Closed Won'.
  2. OpportunityTrigger fires → OpportunityTriggerHandler detects the stage transition and calls OnboardingService, which creates one Onboarding__c record for the Account plus five templated Onboarding_Task__c children (Kickoff call, Data migration, Config & setup, User training, Go-live sign-off).
  3. On creation, OnboardingService publishes an Onboarding_Created__e platform event — this is the seam SyncBridge subscribes to in order to provision the customer in an ERP.
  4. Consultants work the onboarding in the onboardingConsole LWC: filter by All / My Onboardings / At Risk, see health/status/progress, expand a card, and check off tasks.
  5. Onboarding_Health_Watchdog, a record-triggered Flow, flips Health__c to At Risk whenever the go-live date has passed and the onboarding isn't Complete.

Architecture

Schema

  • Onboarding__c (Lookup → Account, Lookup → Opportunity, Lookup → User) — Status, Health, Go-Live Date, Deal Amount, Apex-maintained Progress %. Auto-numbered ONB-{00000}. List views: All Onboardings, My Onboardings, At Risk.
  • Onboarding_Task__c (Master-Detail → Onboarding__c) — Status (Open/Done), Sequence, Due Date.
  • Onboarding_Created__e (Platform Event, high-volume) — Account Id, Opportunity Id, Onboarding Id, Amount, all as flat text/number so any external subscriber (Salesforce or otherwise) can consume it without joins.

Apex (force-app/main/default/classes, .../triggers)

  • OpportunityTrigger → thin, delegates to OpportunityTriggerHandler.
  • OpportunityTriggerHandler → detects Closed-Won transitions in bulk, calls OnboardingService.
  • OnboardingService → creates Onboarding + Task records, publishes the platform event via EventBus.publish(), and recalculates Progress__c from task completion. Fully bulk-safe: no SOQL/DML inside loops, dedupes by querying existing onboardings once per call.
  • OnboardingTaskTrigger / OnboardingTaskTriggerHandler → on insert/update/delete of a task, recalculates the parent's Progress__c.
  • OnboardingController → @AuraEnabled(cacheable=true) getOnboardings(filterName) and @AuraEnabled completeTask(taskId) for the LWC.
  • Test classes (OpportunityTriggerHandlerTest, OnboardingServiceTest, OnboardingControllerTest) cover single-record and 200-record bulk paths, the idempotency guard (a non-stage Opportunity update must not create a duplicate onboarding), progress math, event publishing (Test.getEventBus().deliver() + EventBus.TestUtils.getPublishedFieldValues), and controller reads/writes.

LWC (force-app/main/default/lwc)

  • onboardingConsole — main console, placed on the OnboardHub_Home Lightning App Page. Filter tabs, cards with status/health badges, progress bar, expandable task checklist that calls completeTask and refreshes via refreshApex.
  • onboardingProgressBar — small reusable child component rendering a color-coded percentage bar.

Automation

  • Onboarding_Health_Watchdog — record-triggered Flow on Onboarding__c (after save, create/update). One decision, one "update triggering record" element: Go_Live_Date__c < TODAY() AND Status__c != 'Complete' → Health__c = 'At Risk'.

App shell & access

  • Custom Lightning app OnboardHub with tabs for the OnboardHub_Home app page, Onboardings, Onboarding Tasks, Accounts, and Opportunities.
  • Permission set OnboardHub_Admin grants object/field access on both custom objects, tab visibility, and Apex class access to OnboardingController.

Deploy runbook

  1. Install the Salesforce CLI: https://developer.salesforce.com/tools/salesforcecli
  2. Log into your free Developer Edition org and alias it:
    sf org login web -a onboardhub
    
  3. Deploy the project:
    sf project deploy start -o onboardhub
    
  4. Assign yourself the permission set:
    sf org assign permset -n OnboardHub_Admin -o onboardhub
    
  5. Seed demo data (creates accounts, contacts, and opportunities, closes several of them to fire the real automation, and adds status/health variety):
    sf apex run -o onboardhub -f scripts/apex/seed.apex
    
  6. Open the app:
    sf org open -o onboardhub
    
    Then launch the OnboardHub app from the App Launcher and open the Home tab.

After these steps the console shows a working system with zero manual clicking: multiple onboardings in different health/status states, one already flagged At Risk by the Flow, one Complete, and one In Progress with two of five tasks already checked off.

Running tests

sf apex run test -o onboardhub -c -r human

Target is ≥90% overall coverage; the org-wide minimum to deploy with tests is 75%. All Apex is bulk-safe (no SOQL/DML in loops) and was written to handle 200-record batches, matching Salesforce's default trigger batch size.

SyncBridge tie-in

OnboardHub is the Salesforce-native half of the SyncBridge integration story:

  • Onboarding_Created__e is the event an external integration (SyncBridge) subscribes to via the Pub/Sub API (or CometD) to know the instant onboarding begins for a customer, so it can provision that customer in an external ERP without polling.
  • Closed-Won Opportunities are what an external poller queries via a scheduled job or the same event stream, giving SyncBridge the deal context (account, amount) it needs to reconcile Salesforce with the ERP record.

Together, the two projects demonstrate both sides of an event-driven, platform-to-external-system integration: OnboardHub emits real signals from real Salesforce automation, and SyncBridge is the consumer that acts on them.

Project structure

onboardhub/
  sfdx-project.json
  .forceignore
  README.md
  force-app/main/default/
    objects/            Onboarding__c, Onboarding_Task__c, Onboarding_Created__e (+ fields, list views)
    triggers/            OpportunityTrigger, OnboardingTaskTrigger
    classes/             handlers, service, controller, and all *Test classes
    lwc/                 onboardingConsole, onboardingProgressBar
    flows/               Onboarding_Health_Watchdog.flow-meta.xml
    flexipages/          OnboardHub_Home (hosts onboardingConsole)
    tabs/                Onboarding__c, Onboarding_Task__c
    applications/        OnboardHub.app-meta.xml
    permissionsets/      OnboardHub_Admin
  scripts/apex/seed.apex

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages