This is a Salesforce Lightning component that integrates making Help Lightning calls through Salesforce. It integrates into the Cases and WorkOrder objects, allowing the Salesforce user to directly call their contact. It also records the Help Lightning call and associates it with the corresponding Case or WorkOrder.
The Help Lightning Salesforce component is released under the MIT License, copyright (c) 2025 Help Lightning Inc.
This code consists of an apex backend
(hlsfdc/main/default/classes/HLSessionController.cls
) and a
Lightning web component
(hlsfdc/main/default/aura/hlSessions/hlSessions.cmp
).
This component is a managed package distributed by Help Lightning via the Salesforce App Store.
If you are going to release internally, please change the namespace
from helplighting__
to something different!
To do anything, you must first install the sf clitools: https://developer.salesforce.com/docs/atlas.en-us.sfdx_setup.meta/sfdx_setup/sfdx_setup_release_notes.htm
For development, we use a Salesforce DX environment to create
temporary scratch environments. We'll call this scratch envirornment
an ISV
in the following examples.
sf org login web -a ISV -d
This will open your web browser and you can log into the ISV salesforce org. Once authenticated, you can begin creating development environments.
To create a new temporary scratch environment for development, run:
./scripts/setup SCRATCH_ENV_NAME
where SCRATCH_ENV_NAME
can be anything you want. I typically name
them after my JIRA ticket:
./scripts/setup SFDC-48
This script will create the new environment, upload all the code and resources, configure the permissions, then print out a Login URL. Clicking on the URL will open up the scratch environment and automatically log you in.
Once you are in your scratch environment, you need to configure it. There are two things we need to configure:
- The Help Lightning enterprise and partner key
- Adding the Help Lightning component to Cases and WorkOrders
First to configure the Help Lightning Enterprise and Partner Key:
- Go to
Setup
>Custom Code
>Visualforce Pages
- Find
HelpLightingSetup
and click on the icon of two squares with an arrow, just to the right of Security. This will open a preview of the page in a new tab. - For
Enterprise Id
, you will need the Help Lightning Id of your enterprise in production. This can be found in crunch. - For
Private Key
, you will need a private key for your enterprise. If you don't have one, you can manually create one using the Galdr admin api. Be careful doing this, as creating a new key removes any existing keys! - Press
Save
and close the tab.
Second, configure the Cases and WorkOrders to show the Help Lightning Component.
- Click on the 9 dots icon in the upper left hand corner and choose
Contacts
- Click
New
- Fill in a Name and an Email address.
- Click
Save
- Click on the 9 dots icon in the upper left hand corner and choose
Cases
- Click
New
- Under
Contact Name
select your contact. - Under
Case Origin
select any value - Press
Save
- You should now be viewing your case. In the top right, click the
Gear
icon and selectEdit Page
- In the menu on the left, scroll down, and under the
Custom
header, you should seeHelp Lightning
- Click and drag
Help Lightning
and place it somewhere in the center pane. You can place it anywhere you want, although I prefer the top of the main pane. - Click
Save
in the top right. - In the pop up dialog, click
Activate
- In the second pop up dialog, click the
Assign as Org Default
, thenSave
- Press the
<- Back
in the top right corner - You should now see your component in your case!
Assuming you configured everything correctly in Step 1, you should be able to Call Contact or Invite Contact. If the component is giving you an error, please validate the following:
- Your enterprise id was configured correctly
- Your partner key is valid
- Your Salesforce user's email address matches an email address in your Help Lightning enterprise. If not, go to
Setup
>Custom Code
>Visualforce Pages
>HelpLightning_UserSetup
. You can verify your login and override it if necessary.
Once everything is working, follow the exact same steps for the Work Order
.
To develop on the code, using your favorite editor (emacs), make changes locally, save them, then push them to your scratch environment using the following command:
sf project deploy start --target-org SCRATCH_ENV_NAME
Then reload your web browser. Sometimes you have to reload multiple times for your changes to take effect! During development, I often put a print statement at the beginning with a number in it, that I increase every time I push, that way I can view the browser's console log and verify the new version is running
While it is possible to edit code in Salesforce using its built in code editor, it is not recommended, as syncing changes back locally can be frustrating at times.
Salesforce also requires 90+% code coverage, or you cannot distribute your package. Please make sure all new apex code has valid unit tests. You can run all the tests using the following command:
sf apex run test --target-org SCRATCH_ENV_NAME -c -r human --wait 10
We are now using the Second-Generation Package Management. You need to
make sure your account in our DevHUB (ISV) account has the Package Manager
role!
- Basic Workflow for Second Generation Packages
- Details on Generating a Package
- Promoting a Package to the App Store
- Update the ChangeLog
- Update the sfdx-project.json. Make sure the
versionName
matches the ChangeLog. TheversionNumber
should be$versionName.0.1
(They last number can be incremented only if you need to make a new build without making any code changes!
Make sure this is committed and tagged!
- Create a new version:
sf package version create -c --package "Help Lightning" --installation-key-bypass --definition-file config/project-scratch-def.json -v ISV --wait 10
- A URL will be generated. You can test this in another Salesforce environment (not the ISV environment!). This can also be given to customers for testing!
- Run a report to verify things (Note the
-
between the version and patch)sf force package version report --package "Help [email protected]" -v ISV
- Promote the package. This makes it available to be submitted to the App Store
sf force package version promote --package "Help [email protected]" -v ISV
- If you forget the URL, you can use the
Subscriber Package Version Id
from the report, and append it tohttps://login.salesforce.com/packaging/installPackage.apexp?p0=04t8X000000sxx1QAA