Add the force:hasRecordId interface to a Lightning component to enable the component to be assigned the ID of the current record. The current record ID is useful if the component is used on a Lightning record page, as an object-specific custom action or action override in Lightning Experience or the Salesforce app, and so on.

If your component implements force:hasRecordId, you don’t need to add a recordId attribute to the component yourself. If you do add it, don’t change the access level or type of the attribute or the component will cause a runtime error.

The recordId attribute is set only when you place or invoke the component in an explicit record context. For example, when you place the component directly on a record page layout, or invoke it as an object-specific action from a record page or object home. In all other cases, such as when you invoke the component as a global action, or create the component programmatically inside another component, recordId isn’t set, and your component shouldn’t depend on it.

March 21, 2018

1. Remote Process Invocation—Request and Reply
Salesforce invokes a process on a remote system, waits for completion of that process, and then tracks state based on the response from the remote system.

Example:
A custom Visualforce page or button initiates an Apex SOAP or REST callout in a synchronous manner.

2. Remote Process Invocation—Fire and Forget
Salesforce invokes a process in a remote system but doesn’t wait for completion of the process. Instead, the remote process receives and acknowledges the request and then hands off control back to Salesforce.Example:
a. Workflow-driven outbound messaging
b. Outbound messaging and callback
c. Custom Visualforce page that initiates an Apex SOAP or HTTP asynchronous callout3. Batch Data Synchronization
Data stored in Lightning Platform should be created or refreshed to reflect updates from an external system, and when changes from Lightning Platform should be sent to an external system. Updates in either direction are done in a batch manner.

Example:
Leverage a third-party ETL tool that allows you to run change data capture against source data.

Individual object represents a customer’s data privacy and protection preferences. Data privacy records based on the Individual object store customer's privacy preferences and are associated with a lead or a contact.

1. Go to Data Protection and Privacy under Company Settings.

2. Edit Data Protection and Privacy.

3. Save Data Protection and Privacy.

4. Add the Individual field to Lead, Contact, or Person Account page layouts.

March 20, 2018

Once a synchronous Apex request runs longer than 5 seconds, it begins counting against this limit. Each organization is allowed 10 concurrent long-running requests. If the limit is reached, any new synchronous Apex request results in a runtime exception. This behavior occurs until the organization’s requests are below the limit.

({ createRecord : function (component) { var createRecordEvent = $A.get("e.force:createRecord"); createRecordEvent.setParams({ "entityApiName": "Account" }); createRecordEvent.fire(); } })
Once the create record event is fired, it will take to you the newly created account record.

< aura:method > to define a method as part of a component’s API. This enables us to directly call a method in a component’s client-side controller instead of firing and handling a component event. This simplifies the code needed for a parent component to call a method on a child component that it contains.

4. What is Aura?

Aura is the open source technology that powers Lightning Components.

5. Do we need a namespace to develop Lightning Components?

No. Lightning Components used to require a namespace, but that is no longer a requirement.

Lightning Experience is the name for the all new Salesforce desktop app.

8. What is the basic difference between Application Event and Component Event

The major difference between application and component event is that component event is used in child to parent components and application event can be used through out the application.

9. How can we call child component controller method from the parent component controller method?

Yes, we can call using aura methods.

10. What is the use of Document and Renderer in lightning component?

Document – A description, sample code, and one or multiple references to example components
Renderer - Client-side renderer to override default rendering for a component.11. Disadvantages with Lighting Experience 1. All AppExchange products are not lighting ready.
2. It takes more time to migrate complex customized classic Salesforce app to Lightning ready.

12. How to ensure FLS while working with Lightning Component?

Lightning Data Services already ensures Field Level Security and we can also use into the Apex using isAccessible, isCreateable, isDeleteable and etc methods of Schema class.

13. How to add Lightning Component in Visualforce page?

Lightning component can be added to visualforce page using ltng:outApp.

14. How to extend lightning component?

Lighting component can be extended using extensible=”true” attribute in aura:component.

15. What is the use of svg in aura bundle?

Custom icon resource for components used in the Lightning App Builder or Community Builder.

To create a record using Lightning Data Service, declare force:recordData without assigning a recordId. Next, load a record template by calling the getNewRecord function on force:recordData. Finally, apply values to the new record, and save the record by calling the saveRecord function on force:recordData.