Monday, March 5, 2018

Usefull terms

Apex

A procedural scripting language that allows developers to execute flow and transaction control statements in the Force Platform environment. Apex code runs on Force Platform servers and is closely integrated with the Force Platform environment.

App

A collection of components such as tabs, reports, dashboards, and custom s-controls that address a specific business need. Short for “application.”

Analytic Snapshots

Used to capture and store data from a particular point in time.

Application programming interface (API)

The interface that a computer system, library, or application provides in order to allow other computer programs to request services from it and exchange data between them.

Apex-managed sharing

The ability to designate certain sharing entries as protected from deletion when sharing is recalculated.

Approval process

An automated process your organization can use to approve records on the platform. An approval process specifies the steps necessary for a record to be approved and who must approve it at each step. Approval processes also specify the actions to take when a record is approved, rejected, or first submitted for approval.

Auto number

A custom field type that automatically adds a unique sequential number to each record.

Cascading style sheets

Files that contain all of the information relevant to color, font, borders, and images that are displayed in a user interface.

Child relationship

A relationship that has been defined on an SObject that references a selected SObject as the “one” side of a one-to-many relationship. For example, if you expand the Child Relationships node under the Account object, contacts, opportunities, and tasks are included in this list.

Class, Apex

A template or blueprint from which Apex objects are created. Classes consist of other classes, user-defined methods, variables, exception types, and static initialization code. In most cases, Apex classes are modeled on their counterparts in Java and can be quickly understood by those who are familiar with them.

Cloud computing

A virtual development and deployment computing environment that eliminates the need for computing hardware and software infrastructure and components. Developers and users connect to this environment through a browser.

Component, Visualforce

An entity which can be added to a Visualforce page with a set of tags. You can create your own Visualforce components, which can contain multiple standard components.

Controller, Visualforce

An Apex class that provides a Visualforce page with the data and business logic it needs to run. Visualforce pages can use the standard controllers that come by default with every standard or custom object, or they can define custom controllers.

Custom field

Fields that can be added to customize an object for your organization’s needs.

Custom link

A custom URL defined by an administrator to integrate your data with external websites and back-office systems.

Custom object

An entity that you build to store information, analogous to a table in a relational database.

Dashboard

A graphical representation of data from up to 20 summary or matrix reports arranged in a two- or three-column layout. Every user can select a favorite dashboard to display on his or her Home tab.

Data Loader

A Force Platform tool used to import and export data from your Force Platform organization.

Dependent field

Any custom picklist or multi-select picklist field that displays available values based on the value selected in its corresponding controlling field.

Delegated authentication

An security process where an external authority is used to authenticate Force Platform users.

Developer Edition

A free Salesforce edition that allows you to get hands-on experience with all aspects of the platform in an environment designed for development. Developer Edition accounts are available at developer.force.com.

Developer Force

The Developer Force website at developer.force.com provides a full range of resources for platform developers, including sample code, toolkits, an online developer community, and the ability to obtain limited Force Platform environments.

DML statement

An Apex statement that inserts, updates, or deletes records from the Force Platform database.

Email template

A built-in feature that enables you to create form emails that communicate a standard message, such as a welcome letter to new employees or an acknowledgement that a customer service request has been received.

Email service

A service set up for your Force Platform organization that can receive incoming emails and direct them to an Apex class for processing.

Enterprise Edition

A Salesforce edition designed to meet the needs of larger, more complex businesses. In addition to all of the functionality available in Professional Edition, Enterprise Edition organizations get advanced customization and administration tools that can support large-scale deployments.

Field

A part of an object that holds a specific piece of information, such as a text or currency value.

Field dependency

A filter that allows you to change the contents of a picklist based on the value of another field.

Field-level security

Settings that determine whether fields are hidden, visible, read only, or editable for users based on their profiles.

Force Platform

A platform for building cloud computing applications from salesforce.com. The Force Platform provides a full stack of default and extensible functionality which allows you to create cloud computing applications for your entire enterprise.

Force Platform API

A Web services-based application programming interface that provides access to your Salesforce organization’s information.

Force Platform AppExchange

A Web directory where hundreds of AppExchange apps are available to Salesforce customers to review, demo, comment upon, and/or install. Developers can submit their apps for listing on AppExchange if they wish to share them with the community.

Force Platform IDE

An Eclipse plug-in that allows developers to manage, author, debug and deploy Force Platform applications classes and triggers in the Eclipse development environment.

Force Platform Migration Tool

A toolkit that allows you to write an Apache Ant build script for migrating Force Platform applications and components between two Salesforce organizations.

Force Platform Sites

A feature that allows access to Force Platform applications by users outside of a Force Platform organization.

Formula field

A type of custom field that automatically calculates its value based on the values of merge fields, expressions, or other values.

Group

A set of users that can contain individual users, other groups, or the users in a role. Groups can be used to help define sharing access to data.

Group Edition

A Salesforce edition designed for small businesses and workgroups with a limited number of users. Group Edition offers access to accounts, contacts, opportunities, leads, cases, dashboards, and reports.

Home tab

The starting page from which users can view a dashboard, choose sidebar shortcuts and options, view current tasks and activities, or select each of the major tabs.

ID

A unique 15- or 18-character alphanumeric string that identifies a single record in Salesforce.

Import Wizard

An tool for importing data into your Force Platform organization, accessible from the Setup menu.

Instance

A server that hosts an organization’s Force Platform data and runs their applications. The platform runs on multiple instances, but data for any single organization is always consolidated on a single instance.

Junction object

A custom object that implements a many-to-many relationship between two other objects.

Lookup relationship

A relationship between two objects that allows you to associate records with each other. On one side of the relationship, a lookup field allows users to click a lookup icon and select another record from a list. On the associated record, you can then display a related list to show all of the records that have been linked to it.

Managed package

A collection of application components that are posted as a unit on Force Platform AppExchange, and that are associated with a namespace and a License Management Organization. A package must be managed for it to be published publicly on AppExchange, and for it to support upgrades.

Many-to-many relationship

A relationship where each side of the relationship can have many children on the other side. Implemented through the use of junction objects.

Manual sharing

Record-level access rule that allows record owners to give read and edit permissions to other users who might not have access to the record any other way.

Matrix report

A report that presents data summarized in two dimensions, like a spreadsheet.

Metadata

The foundation of Force Platform applications. Metadata is used to shape the functionality and appearance of Force Platform applications. A developer modifies the metadata to create an application, and the Force Platform uses metadata to create application components as needed.

Merge field

A field you can place in an email template, custom link, or formula to incorporate values from a record. For example, Dear {!Contact.FirstName}, uses a contact merge field to obtain the value of a contact record’s First Name field to address an email recipient by his or her first name.

Mini-Page Layout

A reduced display of information about a record that can be enabled to display when a user leaves their mouse on a link to the record.

Multitenancy

An application model where all users and apps share a single, common infrastructure and code base.

MVC (Model-View-Controller)

A design paradigm that deconstructs applications into components that represent data (the model), ways of displaying that data in a user interface (the view), and ways of manipulating that data with business logic (the controller).

Namespace

A one- to 15-character alphanumeric identifier that distinguishes your package and its contents from packages of other developers on Force PlatformAppExchange, similar to a domain name. Salesforce automatically prepends your namespace prefix, followed by two underscores (“__”), to all unique component names in your Salesforce organization.

Object

In Force Platform terms, an object is similar to a database table—a list of information, presented with rows and columns, about the person, thing, or concept you want to track. An object is the core component of the data-driven Force Platform environment, with automatically generated user interfaces, a security and sharing model, workflow processes, and much more.

Object-level security

Settings that allow an administrator to hide whole tabs and objects from a user, so that they don’t even know that type of data exists. On the platform, you set object-level access rules with object permissions on user profiles.

One-to-many relationship

A relationship in which a single object is related to many other objects. For example, each Candidate may have one or more related Job Applications.

Organization, or org

The virtual space provided to an individual customer of salesforce.com. Your org includes all of your data and applications, and your org is separate from all other organizations.

Organization-wide defaults

Settings that allow you to specify the baseline level of data access that a user has in your organization. For example, you can make it so that any user can see any record of a particular object that’s enabled in their user profile, but that they’ll need extra permissions to actually edit one.

Outbound message

A SOAP message from Salesforce to an external Web service. You can send outbound messages from a workflow rule or Apex.

Package

A group of Force Platform components and applications that are made available to other organizations through a publish and subscribe architecture.

Page layout

The organization of fields, custom links, related lists, and other components on a record detail or edit page. Use page layouts primarily for organizing pages for your users, rather than for security.

Personal Edition

A free Salesforce edition designed for an individual sales representative or other single user. Personal Edition provides access to key contact management features such as accounts, contacts, and synchronization with Outlook. It also provides sales representatives with critical sales tools such as opportunities.

Picklist

A selection list of options available for specific fields, for example, the Country field for a Candidate object. Users can choose a single value from a list of options rather than make an entry directly in the field.

Picklist values

The selections displayed in drop-down lists for particular fields. Some values come predefined, and other values can be changed or defined by an administrator.

Platform Edition

A Salesforce edition based on either Enterprise Edition or Unlimited Edition that does not include any of the standard Salesforce CRM apps, such as Sales or Service & Support.

Production organization

A Salesforce organization that has live users accessing data.

Professional Edition

A Salesforce edition designed for businesses who need full-featured CRM functionality. Professional Edition includes straightforward and easy-to-use customization, integration, and administration tools to facilitate any small- to mid-sized deployment.

Profile

A component of the platform that defines a user’s permission to perform different functions. The platform includes a set of standard profiles with every organization, and administrators can also define custom profiles to satisfy business needs.

Queue

A collection of records that don’t have an owner. Users who have access to a queue can examine every record that’s in it and claim ownership of the records they want.

Record

A single instance of an object. For example, Software Engineer is a single Position object record.

Record name

A standard field on all Force Platform objects. Whenever a record name is displayed in a Force Platform application, the value is represented as a link to a detail view of the record. A record name can be either free-form text or an autonumber field. The Record Name does not have to be a unique value.

Record-level security

A method of controlling data in which we can allow particular users to view and edit an object, but then restrict the individual object records that they’re allowed to see.

Related list

A section of a record or other detail page that lists items related to that record.

Relationship

A connection between two objects in which matching values in a specified field in both objects are used to link related data. For example, if one object stores data about companies and another object stores data about people, a relationship allows you to find out which people work at the company.

Report types

The foundation of Force Platform reports. A report type specifies the objects and their fields that can be used as the basis of a report. Standard report types are created by the Force Platform, while you can create custom report types for more advanced or specific reporting requirements.

Role hierarchy

A record-level security setting that defines different levels of users such that users at higher levels can view and edit information owned by or shared with users beneath them in the role hierarchy, regardless of the organization-wide sharing model settings.

Roll-Up Summary Field

A field type that automatically provides aggregate values from child records in a master-detail relationship.

S-Control

A component that allows you to embed custom HTML and JavaScript into Salesforce detail pages, custom links, Web tabs, or custom buttons. For example, you can define a custom s-control containing JavaScript and address merge fields to display a map of a contact’s address. The functionality provided by s-controls has been replaced by Visualforce.

Sandbox organization

A nearly identical copy of a Salesforce production organization. You can create multiple sandboxes in separate environments for a variety of purposes, such as testing and training, without compromising the data and applications in your production environment.

Search layout

The organization of fields included in search results, lookup dialogs, and the recent items lists on tab home pages.

Session ID

An authentication token that’s returned when a user successfully logs in to Salesforce. The Session ID prevents a user from having to log in again every time he or she wants to perform another action in Salesforce.

Session timeout

The amount of time a single session ID remains valid before expiring. While a session is always valid for a user while he or she is working in the Web interface, sessions instantiated via the API expire after the duration of the session timeout, regardless of how many transactions are still taking place.

Setup menu

Interface to Force Platform metadata that allows you to create and shape Force Platform applications. You get access to the Setup menu through the Setup link in a standard Force Platform application.

Sharing model

A security model that defines the default organization-wide access levels that users have to each other’s information.

Sharing rules

Rules that allow an administrator to specify that all information created by users within a given group or role is automatically shared to the members of another group or role. Sharing rules also allow administrators to make automatic exceptions to org-wide defaults for particular groups of users.

SOQL (Salesforce Object Query Language)

A query language that allows you to construct simple but powerful query strings and to specify the criteria that should be used to select the data from the database.

SOSL (Salesforce Object Search Language)

A query language that allows you to perform text-based searches using the API.

Standard object

A built-in object included with the Force Platform. You can also build custom objects to store information that’s unique to your app.

Tab

An interface item that allows you to navigate around an app. A tab serves as the starting point for viewing, editing, and entering information for a particular object. When you click a tab at the top of the page, the corresponding tab home page for that object appears. A tab can be associated with a Force Platform object, a web page or a Visualforce page.

Tag

An identifier that can be attached by a user to an individual record. Force Platform tags can be public or private.

Test method

An Apex class method that verifies whether a particular piece of code is working properly. Test methods take no arguments, commit no data to the database, and can be executed by the runTests() system method either via the command line or in an Apex IDE, such as Eclipse with the Force Platform IDE.

Time-dependent workflow action

A workflow action that occurs before or after a certain amount of time has elapsed. Time-dependent workflow actions can fire tasks, field updates, outbound messages, and email alerts while the condition of a workflow rule remains true.

Trigger

A piece of Apex that executes before or after records of a particular type are inserted, updated, or deleted from the database. Every trigger runs with a set of context variables that provide access to the records that caused the trigger to fire, and all triggers run in bulk mode—that is, they process several records at once, rather than just one record at a time.

Trigger context variables

Default variables that provide access to information about the trigger and the records that caused it to fire.

Unlimited Edition

A Salesforce edition designed to extend customer success through the entire enterprise. Unlimited Edition includes all Enterprise Edition functionality, plus Apex, Force Platform Sandbox, Force Platform Mobile, premium support, and additional storage.

Unmanaged package

A Force Platform AppExchange package that cannot be upgraded or controlled by its developer. Unmanaged packages allow you to take any app components and move them “as is” to AppExchange without going through a lengthy publishing process.

URL (Uniform Resource Locator)

The global address of a website, document, or other resource on the Internet. For example, http://www.salesforce.com.

Validation rule

A rule that prevents a record from being saved if it does not meet the standards that are specified.

Visualforce

A simple, tag-based markup language that allows developers to easily define custom pages and components for apps built on the platform. Each tag corresponds to a coarse or fine-grained component, such as a section of a page, a related list, or a field. The components can either be controlled by the same logic that’s used in standard Salesforce pages, or developers can associate their own logic with a controller written in Apex.

Web service

A mechanism by which two applications can easily exchange data over the Internet, even if they run on different platforms, are written in different languages, or are geographically remote from each other.

WebService method

An Apex class method or variable that can be used by external systems, such as an s-control or mash-up with a third-party application. Web service methods must be defined in a global class.

Web tab

A custom tab that allows your users to use external websites from within the application.

Wizard

A user interface that leads a user through a complex task in multiple steps.

Workflow action

An email alert, field update, outbound message, or task that fires when the conditions of a workflow rule are met.

Workflow email alert

A workflow action that sends an email when a workflow rule is triggered. Unlike workflow tasks, which can only be assigned to application users, workflow alerts can be sent to any user or contact, as long as they have a valid email address.

Workflow field update

A workflow action that changes the value of a particular field on a record when a workflow rule is triggered.

Workflow outbound message

A workflow action that sends data to an external Web service, such as another cloud computing application. Outbound messages are used primarily with composite apps.

Workflow queue

A list of workflow actions that are scheduled to fire based on workflow rules that have one or more time-dependent workflow actions.

Workflow rule

A “container” for a set of workflow instructions that includes the criteria for when the workflow should be activated, as well as the particular tasks, alerts, and field updates that should take place when the criteria for that rule are met.

Workflow task

A workflow action that assigns a task to an application user when a workflow rule is triggered.

Tuesday, February 27, 2018

Lightning Interview Questions


1. What are the type of events into Salesforce Lightning component?

a. Application Event – Scope of this event is throughout the lightning App and any component which has registered for this event would get a notification.
b. Component Event– Scope of this event is within itself or the parent component of this event, all the components declared within the parent component would get notified of this event.
c. System Event- these are the events fired by Salesforce’s system during the lifecycle of the lightning app.

2. What are the basic differences between Application Event and Component Event?

Component events are used to do communication between child and parent. They use bubbling and capture same as used in DOM events. A change in a child component can be communicated to the parent component via component event.

Application events are used to communicate any change in the component to a broader audience. Any component who has registered for this event will get a notified.
To use Component Event API we use the below syntax

3. When should we use Component event and application events?

It is best to always use a component event instead of an application event. Component events can only be handled by components above them in the containment hierarchy, therefore, their usage is localized to the components that need to know about them.

Application events are best used for something that should be handled at the application level, such as navigating to a specific record. Application events allow communication between components that are in separate parts of the application and have no direct containment relationship.

4. Which interface we are supposed to implement so that a lightning component can be used as quick action?

We need to implement the following “force: lightningQuickAction” so that we can use the component as a Quick Action

5. Which interface we are supposed to implement so that a lightning component can be used as a Tab?

We need to implement the following “force:appHostable” so that we can use the component as a Tab

6. How can we use a lightning component in a VisaulForce Page? Explain?

A Lightning component can be embed in any webpage using a very powerful and flexible feature, Lighting out. When used with Visualforce some complexity becomes simpler.
Lightning component can be added to Visualforce page in three steps:

1. We have to first Add the Lightning Components for Visualforce JavaScript library to your targetted Visualforce page using the tag.

2. Next we have to create and refer a Lightning app which is used to the component dependencies.

3. Lastly we need to write a JavaScript function which will finally create the the component on the page using $Lightning.createComponent()

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

To call a child component’s controller method, we need to first create a aura:method which is publically accessible, aura:method is used to communicate down the containment hierarchy i.e. parent to child. Sample code for implementing the aura method:
Component code

Controller
({
publicmethod: function(cmp, event) {
var params = event.getParam(‘arguments’);
if (params) {
var message = params. str;
console.log(“message: ” + message);
return message;
}
}
})

Calling the cild method from parent controller
({
callchildCompMethod : function(component, event, helper) {
var childCmp = component.find(“childCompName”);
var Result =
childCmp. publicmethod (“message sent by parent component”);
console.log(“Result: ” + Result);
}
})

8. What are the different Lightning component bundles?
a. Component
b. Controller
c. Helper
d. Style
e. Document
f. Design
g. SVG
h. Rendrer

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

FLS and CRUD are not automatically enforced in the lightning component whenever any object is referenced in the Apex Controller and the component will display the fields and records for which the users do not have access. Therefore we should manually enforce the FLS and CRUD in the Apex Controller, or we should try to use Lightning Data service wherever possible because it takes care of FLS and CRUD for us.

10. How can we use Lightning Components with the Salesforce1 Mobile App ?

For this purpose we need to first make a lightning tab which points to the lightning component we created and then we have to include that tab in the salesforc1 Mobile Navigation select list and the newly created tab to it.

11. Can we make a Lightning Component that shows up in both the mobile and the desktop user interfaces?

Lightning component is lightning experience ready by default and is also compatible in Salesforce1 App, it has a responsive layout therefore it adjust its resolution according the screen size and therefore can be used on desktop as well without writing any separate code.

12. Is Lightning component framework an MVC framework ?

No it is not a MVC framework it is a component based framework and event driven.

13. Which parts of Lightning Components are server-side and which are client-side ?

Lightning components have two types of controller, one which uses javascript and responds to the event occurring in the components at client side and the second controller which is an apex class. Method of apex controller are accessed by the JavaScript controller methods asynchronously.

14. Can we make one component inherit styles/CSS from a parent component, or must we always define it in the component ?

Child component inherits the CSS from its aren’t we do not need to specify it for each component

15. What is the use of the aura:method tag in Lightning ?

aura:method is used to communicate down the containment hierarchy i.e. parent to child

16. Can we Include One Lightning component to another ?

Yes we can include one Lightning component in another Lightning component

17. Is there any limit on how many component to have in one Application?

There is no limit on number of components defined within an application by salesforce

18. Is Lightning Components replacing Visualforce?

No Lightning component is not replacing Visualforce, Visualforce is still supported by Salesforce.

19. What is Aura? Why do we use the aura: namespace in the code?

Aura is a UI framework for developing dynamic web apps for mobile and desktop devices. Aura provides a scalable long-lived lifecycle to support building apps engineered for growth.

Aura supports partitioned multi-tier component development that bridges the client and server. It uses JavaScript on the client side and Java on the server side.

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

You can have namespace in your org but it is not necessary to have a namespace to develop lightning component.

21. What are the tools included in lightning?

Lightning App Builder – It is a tool with User interface to use drag and drop functionality and create app fast by reusing the components, components can be standard or custom depending upon your requirement.
Lightning Component Framework- it provides a bundle that can be used to build reusable custom components, Standalone App and to customize Salesforce1 App
Lightning Connect – it is a powerful tool to facilitate the integration of force.com app with an external data source using OData specification
Lightning Process Builder – it is a visualization tool to build automation required for your business processes.
Lightning Schema Builder – it is a visualizing tool to view, create objects fields and relationship among them.

22. What is difference between Visualforce Components and Lightning Components?

Visualforce page is created keeping page as the center of the application and most of its calculation is performed at the server side. Lightning component on the other hand are created using the component based framework, most of the calculations are performed at the client side and makes the more dynamic and provide rich customer experience, also lightning component are build using mobile first approach.

23. Does Lightning work with Visualforce ?

Yes Lightning component works with Visualforce by implementing Lightning out as discussed earlier.

24. Are there any CSS (styles) provided by salesforce.com as part of the supported Lightning Components ?

Salesforce has provided lightning design system as the default css to be used with Lightning component.

25. Are Lightning Components intended only for mobile apps?

Although lightning framework creates component keeping mobile first approach, but its responsive design helps in providing the same experience over the desktop without writing separate lines of code

26. What are the advantages of lightning?

There are many advantages of using lightning like its out of the box component set which enables the fast paced creation of new apps, its event driven architecture which enables the easy decoupling between the components. Device awareness, cross browser compatibility and framework optimized for the performance.

27. Can we integrate Lightning components with another framework, such as Angular?

Yes we can integrate lightning with any 3rd party framework.

28. Can we include external JavaScript/CSS libraries in components?

It is possible to use custom CSS and JAvascriipt in the Lightning component

29. What happens with existing Visualforce Pages in Lightning Experience?

Most of the Visualforce page can be easily converted to lightning experience, but they are still supported by the salesforce and are not required to be converted

30. Where we can display lightning component?

Lightning component can be displayed at following places:
1. Lightning Experience
2. Salesforce1 App
3. Template-based Community
4. Standalone Lightning App
5. Visualforce Pages (Using Lightning out )

31. Do I always create an app bundle first when develop lightning component ?

No it is not necessary to create an Appp Bundle first to develop the lightning component

32. How can we deploy components to production org?

Lightning component can be deployed to the production via change sets, force.com IDE, Managed Package.

33. What is Lightning Experience?

It is the new user Interface developed by salesforce team, which is built on component based framework and event driven architecture, which provides a dynamic and responsive Experience to the user. This framework is built to provide optimum performance by using stateful Client side and stateless Server architecture

34. What is the use of implements in lightning component?

Implements is use to refer platform interfaces which enables a component to be used in different contexts or to grant access to extra context data, a component can implement more than one interfaces.

35. What is aura:registerevent in lightning component?

aura:registerevent is the notifier component and it declares that it may fire a particular event, it includes ‘name’ attribute which is relevant only to component event and is not used for application event. Other attribute is the ‘type’ which lets the component know which event would be fired.

Ex.

36. How can we subscribe to an event in lightning component?

To subscribe to an event in lightning component we need to include tag in the containment hierarchy. Subscription of these event depends on the event type i.e. component event or application event. For Component event we write below code.


In this ‘name’ attribute in should be exactly as name attribute in tag in the component which has fired the component. The ‘action’ attribute of sets the client-side controller action to handle the event. The ‘event’ attribute specifies the event being handled.
For Handling Application event we write below code

‘Event’ and ‘action’ attribute are same as the component event handling, it is just that we do not include ‘name’ attribute to handle the application event.

37. How can we communicate between two component?

In Lightning Component Framework, the communication between two component is accompalished supported in several ways.
1. Attributes or Methods to pass data down the component hierarchy
2. Lightning Events to pass data up and around in the component hierarchy

38. What is aura definition bundle?

It represents a Lightning definition bundle, it contains a Lightning definition and all its related resources. It could define a component, application, event, interface, or a tokens collection.

An AuraDefinitionBundle component is a collection of component definition files, each representing a different resource such as markup code, event documentations, applications and interfaces.

Lightning bundles must be under a top-level folder that’s named aura. Each bundle must have its own subfolder under the aura folder.

A bundle doesn’t have a suffix but definition files can have one of these suffixes
Suffix Component Type

Suffix
Component Type
.app
Application
.cmp
Component
.design
Design
.evt
Event
.intf
Interface
.js
Controller, Helper, or Renderer
.svg
SVG image
.css
Style
.auradoc
Documentation
.tokens
Tokens collection

39. What is aura:attribute?

They are same as member variable in apex classes, they are typed fields and are instance of a component. Attribute helps in making component more dynamic.

All attributes have a name and a type can be marked required by specifying ‘required=true’and can also have a default value. It has a naming rule as well:

1. Must begin with a letter or an underscore
2. Must contain only alphanumeric or underscore characters

40. What is lightning: or ui: in any lightning component?

Lightning has provided us with common User Interface components in the ui namespace which are used in the lightning component framework. They are ui:input and ui:output provide easy to implement common user interface.
Component with lightning namespace also provides us with the user interface but on top of that they include lightning design system CSS by default so we do not have to worry about the styling of these components.
41. How can we extend any component?

To make a component extendable we need to set value of ‘extensible’ attribute as ‘true’ of the aura:component tag.
When a component extends another component it inherits all of the helper methods and attributes

42. How to register, fire and handle a component and application event?

We register an event by by using the following code


We fire event as shown below:

var compEvent = cmp.getEvent(“sampleComponentEvent”);

compEvent.fire();

Handle component event as below :


    action=”{!c.handleComponentEvent}” phase=”capture” />

Handle Application event as below:


43. Let’s say that you have an app myApp.app that contains a component myCmp.cmp with a ui:button component. During initialization, the init() event is fired in what order?

ui:button, ui:myCmp, and myApp.app.

44. Why do we use @AuraEnabled annotation?

The AuraEnabled annotation provides support for Apex methods and properties to be used with the Lightning Component framework.
The AuraEnabled annotation is overloaded, and is used for two separate and distinct purposes.
1. Use @AuraEnabled on Apex class static methods to make them accessible as remote controller actions in your Lightning components.
2. Use @AuraEnabled on Apex instance methods and properties to make them serializable when an instance of the class is returned as data from a server-side action.

45. Why do we use $A.enqueueAction(action)?

It adds the server-side controller action to the queue of actions to be executed. Rather than sending a separate request for each individual action, the framework processes the event chain and batches the actions in the queue into one request. The actions are asynchronous and have callbacks.

46. Use of THIS CSS class?

This adds namespacing to CSS and helps prevent one component’s CSS from blowing away another component’s styling.

47. What are the different ways to conditionally display markup, and what is the preferred approach?

Using the tag
Use CSS to toggle visibility of markup by calling $A.util.toggleClass(cmp, ‘class’) in JavaScript code.

47. What is $Resource global value provider? Is it possible to obtain a reference to a static resource in Javascript code?

It lets you reference images, style sheets, and JavaScript code you’ve uploaded in static resources.

To obtain a reference to a static resource in JavaScript code, use $A.get(‘$Resource.resourceName’).

48. Let’s say you have several buttons that reuse the same onclick handler. How will you retrieve the name of the button that fired the event?

Use event.getSource() in the client-side controller to get the button component that was clicked. Call

getLocalId() to get the aura:id of the clicked button.

49. What are the names of interfaces that are added to a Lightning component to allow it to be used as custom tabs, and to be used in Lightning and Community builder?

‘force:appHostable’ Allows a component to be used as a custom tab in Lightning Experience or the Salesforce app
‘forceCommunity:availableForAllPageTypes’ To appear in Community Builder, a component must implement the forceCommunity:availableForAllPageTypes interface

50. What is the use of force:hasRecordId interface?

Add the force:hasRecordId interface to a Lightning component to enable the component to be assigned the ID of the current record.
The recordId attribute is set only when you place or invoke the component in a context of a record. For example, when you place the component on a record page, or invoke it as an action from a record page or object home. In all other cases, such as when you create this component programmatically inside another component, recordId isn’t set, and your component shouldn’t depend on it.

51. What is Lightning Design System (SLDS)?

The Salesforce Lightning Design System (SLDS) component library is actively developed to enable Salesforce developers to create a uniform look and feel across all Salesforce-related applications while adhering to CSS best practices and conventions.

52. What is the use of access=“global”?

The framework enables you to control access to your applications, attributes, components, events, interfaces, and methods via the access system attribute. The access system attribute indicates whether the resource can be used outside of its own namespace.
You can specify these values for the access system attribute.

Private: Available within the component, app, interface, event, or method and can’t be referenced outside the resource. This value can only be used for or .Marking an attribute as private makes it easier to refactor the attribute in the future as the attribute can only be used within the resource.
Accessing a private attribute returns undefined unless you reference it from the component in which it’s declared. You can’t access a private attribute from a sub-component that extends the component containing the private attribute.

Public: Available within your org only. This is the default access value.

Global: Available in all orgs.

53. What is Lightning Data Services?

They are similar to a standard controller in Apex coding, advantages of using lightning Data service are mentioned below
1. Use Lightning Data Service to load, create, edit, or delete a record in your component without requiring Apex code.
2. Lightning Data Service handles sharing rules and field-level security for you.
3. In addition to not needing Apex, Lightning Data Service improves performance and user interface consistency.

54. What are Local and Global ids with respect to lightning component?

Component IDs
A component has two types of IDs: a local ID and a global ID. You can retrieve a component using its local ID in your JavaScript code. A global ID can be useful to differentiate between multiple instances of a component or for debugging purposes.

Local IDs
A local ID is an ID that is only scoped to the component. A local ID is often unique but it’s not required to be unique.
Create a local ID by using the aura:id attribute. For example:
Find the button component by calling cmp.find(“button1”) in your client-side controller, where cmp is a reference to the component containing the button.

Global IDs
Every component has a unique globalId, which is the generated runtime-unique ID of the component instance. A global ID (1) is not guaranteed to be the same beyond the lifetime of a component, so it should never be relied on. A global ID can be useful to differentiate between multiple instances of a component or for debugging purposes.

55. What is a FlexiPage in lightning?

FlexiPage
Represents the metadata associated with a Lightning page. A Lightning page represents a customizable screen made up of regions containing Lightning components.
A Lightning page region can contain upto 25 components.

Lightning pages are referred as FlexiPages in API and referred as Lightning pages elsewhere in SFDC documentation

56. How to make quick lightning action?

Add the force:lightningQuickAction or force:lightningQuickActionWithoutHeader interface to a Lightning component to enable it to be used as a custom action in Lightning Experience or the Salesforce mobile app. You can use components that implement one of these interfaces as object-specific or global actions in both Lightning Experience and the Salesforce app.

57. What are value providers in Salesforce Lightning ?
Value providers helps use to access data in Lightning Application .They are two value providers as v(View) and c(controller)
v is component attribute set which helps to access component attribute values in markup
c is component controller helps us to link with event handlers and action for the component

58. List of Global value providers?

$globalID
$Browser
$Label
$Locale
$Resource

59. What are list of tools are avaliable in salesforce lightning ?

Lightning Connect
Lightning Component Framework
Lightning Schema Builder
Lightning Process Builder
Lightning App Builder