function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
wasabi 865wasabi 865 

How to get the name of the app/home page from a lightning component

So I need to be able to get the name of the home page where my lightning component is loaded from. If its loaded on a record page then I simply implement force:hasSObjectName and use sObjectName to get the name of the object, but I can't seem to figure out how to get the name of an app page if the component is loaded there. Thanks in advance for any help. 
Best Answer chosen by wasabi 865
sfdcMonkey.comsfdcMonkey.com
there is no interface available for knowing app/home page in lightning component, however you can check in your lightning component that it's record detail page or not, by force:hasRecordId and force:hasSObjectName, if these return undefined or Null in your component, it's mean, it used from outside from detail page (record context).

Kindly let us know if it helps you, & close this query by selecting best answer if you got your solution,so this will helps other in future
sfdcMonkey.com

 

All Answers

sfdcMonkey.comsfdcMonkey.com
there is no interface available for knowing app/home page in lightning component, however you can check in your lightning component that it's record detail page or not, by force:hasRecordId and force:hasSObjectName, if these return undefined or Null in your component, it's mean, it used from outside from detail page (record context).

Kindly let us know if it helps you, & close this query by selecting best answer if you got your solution,so this will helps other in future
sfdcMonkey.com

 
This was selected as the best answer
wasabi 865wasabi 865
Thanks Piyush as this is what I found as well. Seems like I'll have to customize the component based upon which app/home page I load it in.