• Erick Mori
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I have a Visuaflorce page that works fine with Lightning Experience. It's a page override of an Edit button in a custom object.

In order to avoid the users to leave the page without saving I implemented something like this in javascript in the page:
 
window.onbeforeunload = function() {

    if (...) {
        return 'Are you sure you want to leave? Your changes will be lost';
    }
}
This works like a charm on Classic when the user tries to close the browser, change tabs to another object, or anything that basically makes the Visualforce page be dismissed.

This however doesn't work in LEX. Is there a workaround for this kind of scenarios to avoid users lose changes for navigating away from the page?
Running into a strange issue -- I have developed several lightning components that are displayed in Lightning App Builder. I added a second one that has all the same "implements=" as the other ones, but for some reason is not showing as an option in App Builder. Given the fact that other components are showing up - any ideas/thoughts on things to check? Here is my aura:component line:
 
<aura:component controller="SecureSiteController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes" access="global">