• Steven P. Schram
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I have created a Lightning App that takes a record ID and presents information in a format suitable for printing. Well, better than the standard Lightning Experience detail page, at least. To open this app, I created a Custom Button with the following URL:
/c/MyApp.app#{!Custom_Object__c.Id}
It works, but presents the following message before loading the app:
"We'd like to open the Salesforce page https://domain.lightning.force.com... in a new tab. Because of your browser settings, we need your permission first."
User-added image

This doesn't make sense since it's not an external site. How can I avoid this interruption?
I am encountering expected errors returned in the response argument of my server-side controller action callback function. I can see the error messages in this object by using the Chrome Lightning plugin, but that's only a start. What is the recommended way to pull out these error messages to present to the user? I started with this blog post, but it's very rudimentary and partially inaccurate. For example, the following code from the above blog post is not working for me:
let errors = response.getError();
let message = 'Unknown error'; // Default error message
// Retrieve the error message sent by the server
if (errors && Array.isArray(errors) && errors.length > 0) {
    message = errors[0].message;
}
// Display the message
console.error(message);
message is undefined because the errors object is more complex than this.

Where can I go for the definitive guide to error handling in Lightning Components, particularly with respect to server side calls?
 
I have created a Lightning App that takes a record ID and presents information in a format suitable for printing. Well, better than the standard Lightning Experience detail page, at least. To open this app, I created a Custom Button with the following URL:
/c/MyApp.app#{!Custom_Object__c.Id}
It works, but presents the following message before loading the app:
"We'd like to open the Salesforce page https://domain.lightning.force.com... in a new tab. Because of your browser settings, we need your permission first."
User-added image

This doesn't make sense since it's not an external site. How can I avoid this interruption?
I am encountering expected errors returned in the response argument of my server-side controller action callback function. I can see the error messages in this object by using the Chrome Lightning plugin, but that's only a start. What is the recommended way to pull out these error messages to present to the user? I started with this blog post, but it's very rudimentary and partially inaccurate. For example, the following code from the above blog post is not working for me:
let errors = response.getError();
let message = 'Unknown error'; // Default error message
// Retrieve the error message sent by the server
if (errors && Array.isArray(errors) && errors.length > 0) {
    message = errors[0].message;
}
// Display the message
console.error(message);
message is undefined because the errors object is more complex than this.

Where can I go for the definitive guide to error handling in Lightning Components, particularly with respect to server side calls?