Why would I use lntg:selectSObject?

The Lightning Component Developer Guide reference includes the event lntg:selectSObject. Per the docs, this event:

Sends the recordId of an object when it’s selected in the UI.

However, the sample code doesn’t really help me understand when or why I would use this standard event. Does it cause some sort of interaction with SF1/LEX? Does it mark the record as recently viewed (like FOR VIEW)? Is it just a helpful standard event that all my components can expect?


I just found this description of the events on org62 from PM Eric Jacobson:

ltng:selectSObject is perfect for building master/detail components where you display a list of records and then want another component to display the selected record.

ltng:sendMessage is a general purpose event that dispatches a string message.

Both of these events have an optional “channel” attribute – this is a string that can be used to “tune” your component instances into each other – for example, if you want to put multiple master/detail components onto a page, you can set them to separate channels so that they won’t conflict with each other.

Eric also clarified that there are no “standard” platform components listening for these events, these are just useful building blocks for developers. That said, there may be AppExchange components that use them / listen for them.

Source : Link , Question Author : Christian Carter , Answer Author : Community

Leave a Comment