We all well aware that share button is not available in Lightning Experience. There are many Idea links available, requesting this feature to Salesforce.
If you can’t wait till Salesforce release for this feature, there are few workarounds available on internet.
Lightning Sharing an app available on App Exchange is one of them. It lets you add a Sharing action to any record detail page. Clicking the button takes you to an intuitive place to view, create or modify sharing. And this page allows the user (only admins and record owners) to share their record, or modify who it’s currently shared with.
Here is the demo video:
Well it requires minimal setup to start using this app, here are the steps:
Install App using above link or get it in your local from github
Set sharing settings on whatever object you want manual sharing on (from public read/write to READ or PRIVATE)
Create a custom action on the object that you want to share.
- Name it Sharing
- Set it to Lightning Component
- Select LightningSharingAction for the component
Add that action to the Lightning/S1 actions section on the page layout you want it to appear on.
So far, its an amazing app and full credit goes to developer. Though I felt one shortcoming here, after clicking on Sharing button its navigating to another page where we have two tabs to view all sharings & second one to add permissions/sharing settings.
Instead of navigating to another page, I want to be on same record detail page & open tabs in modal popup. So, I did some changes in components, this is how it look like.Click here to view new UI
To implement this change, replace LightningSharingAction.cmp component with below code and comment doInit code in LightningSharingActionController.js file.
<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" access="global">
<aura:attribute name="modal" type="Boolean" default="true" />
<aura:attribute name="recordId" type="String"/>
<!-- Modal -->
<section style="width:60rem;margin-left:auto;" aura:id="mod" role="dialog" tabindex="-1" aria-labelledby="modal-heading-01" aria-modal="true" aria-describedby="modal-content-id-1" class="slds-modal slds-fade-in-open ">
<div class="slds-modal__container" style="width:100%;max-width:60rem">
<div class="slds-modal__content slds-p-around_medium" id="modal-content-id-1">
<div class="demo-only" >
<div style="opacity:0" aura:id="backdrop" class="slds-backdrop slds-backdrop--open"></div>
For any queries, add your questions on Question/Answer page or in comment section. You can also connect to Technical Experts directly with Live Chat.
Update on 8/19/2019: As many users are complaining that component codes are inaccessible now. So, adding all component codes here.