Tag Archives: Events

System Events in Lightning Framework

System events are fired automatically by the Lightning framework such as during component initialization, attribute value change, rendering etc. All Components can register for system events in their HTML markup.

We can handle these events in the Lightning apps or components, and within the Salesforce mobile app. Here are few examples of system events.

Event Name Description
aura:doneRendering Indicates that the initial rendering of the root application has completed.
aura:doneWaiting Indicates that the app is done waiting for a response to a server request.
aura:locationChange Indicates that the hash part of the URL has
changed.
aura:noAccess Indicates that a requested resource is not accessible due to
security constraints on that resource.
aura:systemError Indicates that an error has occurred.
aura:valueChange Indicates that an attribute value has
changed.
aura:valueDestroy Indicates that a component has been
destroyed.
aura:valueInit Indicates that an app or component has been
initialized.
aura:valueRender Indicates that an app or component has been rendered or
rerendered.
aura:waiting Indicates that the app is waiting for a response to a server request.

SOQL Query for Tasks, Notes and Events by Object Type

Tasks:

//The below query returns a list of Tasks related to Leads
SELECT Id, Who.Id, Who.Type FROM Task WHERE Who.Type = 'Lead'

Notes:

//The below query returns a list of Notes where the parent is a specific type, in this case Opportunity
SELECT Id, Parent.Id, Parent.Type FROM Note WHERE Parent.Type = 'Opportunity'

Events:

//The below query returns a list of Events related to Account and Opportunity
SELECT Id, Subject, What.Type, whatId FROM Event WHERE What.Type IN ('Account', 'Opportunity')