• Stephen Kennicutt
  • NEWBIE
  • 0 Points
  • Member since 2017
  • Software Engineer
  • UpsourceIT

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I've got a requirement across my custom lightning applications and components to throw a javascript alert if the user has logged out during the application lifecyle (for instance, the user's session times out) and if the user attempts to perform any function in the component (e.g. click a button, load data, etc). As of Winter '18 (v 41.0), Salesforce does not rederict to the authentication page and just reports a 500 error to the console. I really need to give direction to my users and let them know that they need to log into thier Salesforce instance again.

I see that there's an application event called "aura:invalidSession", but because the event's accessibility isn't global, I can't even handle that in any of my custom components. I've tried multiple ways to trap the 500 error, but from what I can see from the console, the error is already being handled inside of the lightning production code and all I'm seeing is the result of the console.log() statement when the error is internally handled.

Are there any known ways to check to see if the user's session is still valid inside a custom lightning component? If it's not possible, this is something that REALLY needs to be implemented in the next release of Lightning for Salesforce.

Thanks!
Hello,

We're currently trying to create a lightning component that emulates a Salesforce Classic "Record Detail" page, but we've had to move away from using "force:recordEdit" as we require an extra level of control that "force:recordEdit" does not provide.

This extra control includes enhancements such as hiding the visibility of some of the input fields or requiring fields based on conditional values.

(e.g. if Opportunity.Type = 'New' then show "Field Set A"  else if Opportunity.Type="Renewal" show "Field Set B", else require "Type").

We've had some success trying to use $A.getComponent() to query these input sections according to global Ids, but we are unable to search for the fields that are currently in the layout by their technical name in order to implement our requirements in a programmatic fashion (due to LockerService preventing us from searching the DOM).

Are we missing any ways to interact with "force:recordEdit" that would allow us to fulfill our requirements? We highly doubt that this is the case, but we want to double check.

If what we're attempting to do is impossible within the confines of "force:recordEdit", is there a known way for developers to create a way to pull the Page Layout metadata information for the current User and sObject into Lightning? From looking at Chrome's developer console, force:recordEdit calls an Apex function labeled "getEditRecordLayout" from the related controller, but we haven't been able to track down that method anywhere. Is there a version (either Salesforce or 3rd party) of "getEditRecordLayout" that we could implement for ourselves? 

Thanks for your time.
I've got a requirement across my custom lightning applications and components to throw a javascript alert if the user has logged out during the application lifecyle (for instance, the user's session times out) and if the user attempts to perform any function in the component (e.g. click a button, load data, etc). As of Winter '18 (v 41.0), Salesforce does not rederict to the authentication page and just reports a 500 error to the console. I really need to give direction to my users and let them know that they need to log into thier Salesforce instance again.

I see that there's an application event called "aura:invalidSession", but because the event's accessibility isn't global, I can't even handle that in any of my custom components. I've tried multiple ways to trap the 500 error, but from what I can see from the console, the error is already being handled inside of the lightning production code and all I'm seeing is the result of the console.log() statement when the error is internally handled.

Are there any known ways to check to see if the user's session is still valid inside a custom lightning component? If it's not possible, this is something that REALLY needs to be implemented in the next release of Lightning for Salesforce.

Thanks!
Hello,

We're currently trying to create a lightning component that emulates a Salesforce Classic "Record Detail" page, but we've had to move away from using "force:recordEdit" as we require an extra level of control that "force:recordEdit" does not provide.

This extra control includes enhancements such as hiding the visibility of some of the input fields or requiring fields based on conditional values.

(e.g. if Opportunity.Type = 'New' then show "Field Set A"  else if Opportunity.Type="Renewal" show "Field Set B", else require "Type").

We've had some success trying to use $A.getComponent() to query these input sections according to global Ids, but we are unable to search for the fields that are currently in the layout by their technical name in order to implement our requirements in a programmatic fashion (due to LockerService preventing us from searching the DOM).

Are we missing any ways to interact with "force:recordEdit" that would allow us to fulfill our requirements? We highly doubt that this is the case, but we want to double check.

If what we're attempting to do is impossible within the confines of "force:recordEdit", is there a known way for developers to create a way to pull the Page Layout metadata information for the current User and sObject into Lightning? From looking at Chrome's developer console, force:recordEdit calls an Apex function labeled "getEditRecordLayout" from the related controller, but we haven't been able to track down that method anywhere. Is there a version (either Salesforce or 3rd party) of "getEditRecordLayout" that we could implement for ourselves? 

Thanks for your time.