Apex Interview Questions

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 17

QUESTIONS AND ANSWERS :-

1) Explain about Apex syntax?


Apex has built in support for DML operations like INSERT, UPDATE, DELETE and also DML
Exception handling. It has support for inline SOQL and SOSL query handling which returns the
set of sObject records. We will study the sObject, SOQL, SOSL in detail in future chapters.

Java like syntax and easy to use

Apex is easy to use as it uses the syntax like Java. For example, variable declaration, loop syntax
and conditional statements

2) Does Apex supports unit tests(Test Class)?


ANSWER:-
1) You Cant send message thow test class
2) Test method thow we cannot test web services callout
3)Test method can not commit any data creation

3) What are the limitations of Apex?


ANSWER:-
1) Total number of SOQL queries issued Synchronous Limit:- 100 Asynchronous Limit:-200
2) Total number of records retrieved by SOQL queries :- 50,000
3) Total number of SOSL queries issued :-20
4) Total number of DML statements issued:- 150
5)

4) What are the different types of Apex code development tools?


ANSWER:-

 1)Force.com Developer Console


 Force.com IDE
 Code Editor in the Salesforce User Interface

5) What is aura Register Event ..?


Ans :- register event is the notifire component and it declare that it may fire a Perticular event, it
include name attribute which is relevant to the component event not used for application event ano
the type is component , which event would be fire

6) What is $A.enqueueAction(action)?
ANSWER:-
$A.enqueueAction(action) sends the request the server. More precisely, it adds
the call to the queue of asynchronous server calls. That queue is an optimization
feature of Lightning
7) write down the syntax of list set and map and tell me about
the diffrance between them
ANSWER:-
List<String> lists = new<List> ();
Set<String> sets= new<String> ();
Map<id, value> maps= new map<id, value>();
List Set Map

The list interface Set does not allow The map does not allow
allows duplicate duplicate elements. duplicate elements
elements

The list maintains Set do not maintain The map also does not
insertion order. any insertion order. maintain any insertion order.

We can add any But in set almost The map allows a single null
number of null only one null value. key at most and any number
values. of null values.

List Set implementation Map implementation classes


implementation classes are HashMap, HashTable, Tr
classes are Array are HashSet, Linked eeMap, ConcurrentHashMap
List, LinkedList. HashSet, , and LinkedHashMap.
and TreeSet.

8) Whatever the query language in the salesforce like how many query
language in the salesforce
Answer:- Like there are two language we can use to salesforce
Which is 1)SOQL 2)SOSL

9) can we fetch data from two object in soql query


ANSWER:-
Yes we Can Fetch the data form two object but they have reletionship

10) What are the best practice while writting the trigger
ANSWER:-
1) one object on trigger
2) Bulkification
3) Use soql query for loop
4) Use only required event
5) Use context specific handler method
11) Use unique Naming convention
11 )What are the best practice while writting in test
classAnswer:-
1) test class have must writtern @isTest
2) 75% code coverage is required
3) One assert statement is required per method 1 assertEquals
4) You can use @isTest or testmethods
5) Create test Factory class using @isTest Method
6) Avoid using hard code

12 )what is (see all data = true) annotation in test


classAnswer:-
1)open up data access to records in your organization

13)Tell me one thing i am having two object in my org there is


reletionshiopbetween them and this reletionshiop have chiled record have not
depend on parent record they can existed without parent record
so my requrment have the one parent record have only one chiled record
not more then that
ANS:- That Time if you want to write trigger so that ok and one of the way
Is you can go to formula and set that field value less then or equal to true

14)what are the diffrant type of report in salesforce


Answer:-
1) Matrix Report
2) Tabular report
3) Summary report
4) Joined report

15) how many types of dashborad


AnsWer:-
1) Static dashboard
2) Dynamic dashboard

16)can we schedule the dyanamic dashboard


Answer:-
1)Yes we can Schedule dyanmic dashboard

17)Explain me the salesforce security model


Answer:-
1) Object Level Security
2) Record Level Security
3) Field Level security

18) tell me diffarance between role and profile


Ans:- Role:- Role is the of the hirarchy where you stand
Role is the whom you report in that hierarchy is the role
Role is visible data to your junior maneger not senior maneger
Role is not mandatory in the system
Like we have to say banking system
ZSM-RSM-ASM-RM-RO
Like wies there are some of role in the company

Profile:- profile is the mandatory


Profile can deside which data can see the user
Profile every user have 1 profile
Without use can not do anything the system

19)What are types of evaluation criteria in workflow salesforce


Answer:-
1) Created
2) Created and edited
3) Created and edited and subsequentely meet the criteria

20)what is cascading delete


Ans:- cascade delete are form in the master detail reletionship
When parent record is delete the child record will be delete automatically
Cascade delete is the inbuilt function the master detail reletionship

21)how many types of action having in the process builder


Ans:- There have 8 types of action in process builder
1) create a record
2) Update a record
3) Launch flow
4) Quick action
5) Apex
6) Send an email
7) post to chatter
8) Send an approval

22)what are the disadvantage and advantage of cascading delete


Ans:- you don’t acces for contact but when you delete parent
That time automatically delete child even you don’t have acess
For tha object
This wll override sharing setting that is dis- advantages

23)what is record type why its importance


Ans:-
 1)Displaying different page layouts for one object based on business requirements.
 2)Showing different picklist values based on the requirements.
 3)Restrict field access on layouts based on record types and page layouts.
 4)Restrict creation of certain type of record using profile and record type assignment
24) what is page layout why its importance
Ans:- 1) Page Layout in Salesforce allows us to customize the design and organization of
detail and edit pages of records in Salesforce.
3) Page layouts can be used to control the appearance of fields, related lists, and custom links on
standard and custom object's detail and edit page.
25)how many pagelayout to we can assign to single profile for an a single object
Ans:-It's important to note that you can only apply one Page Layout to one group of users per object, per Record
Type. For example, if you have one Record Type on the Accounts object, you can only apply one Page Layout per
profile

26)how many ways we can make field mandatory


Answer:-
1) when creating field
2) Page layout
3) Validation rule
4) Trigger

27)How to apex class in aura component..?


Answer:-
First we have to defined @auraEnabled in apex class and in aura component
We have to define controlloer and that controller name have that apex class
Name

28)Diffrance Between Trigger and Process Builder..?


ANSWER:-
1) Process Builder Cannot handel before DML it can not handle delete and undelete dml
2) Trigger can handle this all senerio
3) When you work on process Builder . Process builder is more generic which make you to very
difficult to find out the error
4) With the trigger exception handling is more specific
5) When user use process builder then its all or None Case Process builder can fail so its total fail
6) In Apex trigger trigger will run partial run is possible

29)Test Class is Mandatory for every class in apex..?


Answer:
Yes its mandatory beacause its best practices

30)What is asyncronus process…? and Why it is use..?


Answer:-
1) Asyncronus apex is used to run process in seprate thread
2) Asyncronus apex is process is the process that run in task in the backgroud
3) It is use to not wait for the job Ia not my attension
4) Asyncronus provide higher limit

31) Types of Asnycronus apex..?


Answer:-
1) Future Method:-
1) Run in their own thred
2) Do not start until resource ate available
3) Use in web service call out
2) Batch apex:-
1) Run large job that would excced normal processing limit
2) Use in data clesing or data archiving
3)Queable apex:-
1) Similar to future method but additonal provide job chaning to allow more complex data
2) use in perfoming sequential processing opration using web service
4)Schedule apex:-
1)Schedule apex are run in the specific timing
2)Daily or weekely task
32)What is mean by AURA if
Ans:- aura:if evaluates the isTrue expression on the server and instantiates components in either
its body or else attribute. Only one branch is created and rendered. Switching condition unrenders and destroys the
current branch and generates the other

33)What is Aura Bundle..?


Answer:-
1) Controller
2) Helper
3) Svg
4) Css
5) Rendere
6) Design
7) documentation

34)Lightning component are based on mvc architexture..?


Ans:- Model view controller (MVC) is a software architecture pattern which separates the
representation of information from the user’s interaction with it
8) Yes it is based on MVC architexture
2)Reliablitliy
3) high reuse
4) very low development cost
5)easy to maintain

35) What is use of helper.js..?


Ans:- 1)functions that you want to reuse in the component’s helper. Helper functions also enable
specialization of tasks, such as processing data and queueing server-side actions
2)Helper functions are local to a component, improve code reuse, and move the heavy
lifting of JavaScript logic away from the client-side controller

36) Is lightning server side or clinet side stateful..?


Ans:- The Lightning Component framework uses a stateful client and stateless server architecture
that relies on JavaScript on the client side to manage UI component metadata and application
data. The client calls the server only when necessary, and the server only sends data that is
needed by the user to maximize efficiency

37) Why we use Database.BatchableContext…?


Ans. :- This will hold Batch Apex Information…
Like how will you know our code is execute or not
Every time you want to go database and check our code is running properly or not

38)How many events do we have in Aura components? How are they used?
Answer: There are three types of events:

Component Events : Used when data is sent from child to parent.


Application Events : Used when data is sent from one component to another component
which are not in any hierarchy
Standard Out of Box Events : Some default events which can be used by us. Example: showToast."
Whenever Lead is created with LeadSource as Local then give rating as
cold otherwise hot.

39)What is Database.Stateful..?
Ans:- If we have to have the total count the records which were processed in the batch apex, should we use
both Database.stateful

40)What is Service Cloud?


ANS:- 1)Salesforce Service Cloud is a customer relationship management (CRM) platform for
customer service and support. Salesforce based Service Cloud on its Sales Cloud product, a
popular CRM software for sales professionals.
2)Customizing Report
3)live agent web chats
4)Service Entitlement
5)knowledge management
6)Case Management

41) What is Custom object and Standerd object?


ANS:- 1) Standerd Object:-Standard objects are objects that are included with Salesforce.like
Account, Contact, Lead, and Opportunity are all standard objects
2)Custome Object:-Custom objects are objects that you create to store information that's
specific to your company or industry.

42) Diffrance between Lookup Reletionship and Master Detail Reletionship

ANS:-Master-Detail Relationship:
 It is a tightly coupled record that has a direct dependency between the two objects. It can also
be described as a parent-child relationship.
 The record of detail cannot be created without a master.
 The sharing rules are inherited from the master to the detail record.
 We cannot update the relationship to the master in a master-detail relationship.
 The number of master-detail relationships that can be used is limited to 2.
 Master-detail relationships are automatically included in report record types.
 We also cannot set the profile object permissions for the record of detail.
 If a master record is deleted then the record of its detail also gets deleted along with it, that is, it
implements cascade delete.
Roll-Up Summary can be created on a master detail.

Lookup Relationship:

 This type of relationship can be used when we just need to have the relationship between two
objects but not a direct dependency on each other.
 This is a loosely coupled relationship.
 These are used to reference commonly shared data, such as reference data.
 The maximum number of lookup relationships in a field can be 40.
 They are used to link two objects together when we do not want to have the behavior of the
master-detail like sharing rules, profile permissions, and cascade delete.
 Lookups are used when we need to relate multiple ‘parents’ to the record of detail.
 Deletion of the parent just deletes the related field in the child but not the whole record.
 This type of relationship is also like a one-to-many relationship.

43)What is mean OWD …?


ANS:-Organization Wide Defaults(OWD) in salesforce is the baseline level of access that the
most restricted user should have. Organizational Wide Defaults are used to restrict access.
You grant access through other means like(sharing rules, Role Hierarchy, Sales Teams and
Account teams, manual sharing, Apex Sharing ). In simple words Organization Wide
Defaults(OWD) specify the default level of access users have to each other’s records.

44)why we use permision set?


ANS:-1) we can use permission set for give some extra access to the user
2)A permission set is a collection of settings and permissions that give users access to
various tools and functions. Permission sets extend users' functional access without changing
their profiles

45) Using permission set can we ristrict the access?


ANS:- NO

46)what is profile?
ANS:-A profile is a group/collection of settings and permissions that define what a user can
do in salesforce. A profile controls “Object permissions, Field permissions, User permissions, Tab
settings, App settings, Apex class access

47) What is invocablemethod?

@InvocableMethod annotation is required for calling any apex method from flow.

For Flow, care should be taken to retrieve records once and then loop through them rather than
repeatedly retrieving records through multiple loops (this is equivalent to not performing SOQL
within a loop).

48)Can we change the data type of variable once we have created in lightning flow designer?

No we cannot change the data type once created

49)What is a bucket field in reports?


A bucket field lets you group related records together by ranges and segments, without the use of
complex formulas and custom fields. Bucketing can thus be used to group, filter,
or arrange report data. When you create a bucket field, you need to define multiple categories
(buckets) that are used to group report values.

The advantage is that earlier, we had to create custom fields to group or segment certain data.

50)What are dynamic dashboards? Can dynamic dashboards be


scheduled?
Before we understand dynamic dashboards, let us first understand static dashboards. Static
dashboards are the basic dashboard types that will be visible to any user who has made a report
out of his data. An example of this is what a Sales manager/ Marketing manager would be able to
see on his Salesforce org. In other words, a normal dashboard shows data only from a single
user’s perspective. Now comes the concept of dynamic dashboards.

Dynamic dashboards are used to display information which is tailored to a specific user. Let us
consider the same example as above. In case the Sales manager wants to view the report
generated specific to only one of his team members, then he can use dynamic dashboards.
You can use dynamic dashboards when you want to show user-specific data of a particular user,
such as their personal quotas and sales, or number of case closures, or leads converted etc.
You can also use a normal/ static dashboard when you want to show regional or organization-wide
data to a set of users, such as a particular region’s sales number, or a particular support team’s
performance on case closures.

As far as the second part of the question is concerned, no we cannot schedule a dynamic
dashboard. That is because whenever we open the dashboard, it will show the data generated in
real-time

51)what is mean by dependant picklist


Ans:- A dependent picklist is a custom or multi-select picklist for which the valid values
depend on the value of another field, called the controlling field

52) What is Schema Builder


ANS:-Schema Builder is a tool within Salesforce.com that is used to view and manage objects,
fields, and relations between objects in a graphical interface

53) one to one relationship..?


Ans:- Sometimes we may need One To One relationship, But unfortunately Salesforce doesn’t
allow any direct methodology to build One To one relationship.

54) what is unique field


Ans:-The 'Unique ID' field is a setting which prevents the same value from being used in multiple
records for any specific field. External IDs are often created with the 'Unique ID' setting so that the
External IDs will be unique to each record

55) What is promises in salesforce..?


Ans:-Promises simplify code by handling the success or failure of asynchronous calls and
allowing operations to be chained together. For the most part, promises are usually used for
callouts to get data or do an operation on data (CRUD, etc) or do some other operation
through apex or the Force.com platform

56) what is sales cloud..?


ANS:- 1)Salesforce Sales Cloud is a customer relationship management (CRM) platform
designed to support sales, marketing and customer support in both business-to-
business (B2B) and business-to-customer (B2C)
2) Account contact management
3) Opportunity management
4) Lead management

57)what is new datatype added in salesforce


ANS:- Time

58)Cross object..?
ANS:-A Cross-object formula is a formula that spans two related objects and references merge
fields on those objects. A cross-object formula can reference merge fields from a master
(“parent”) object if an object is on the detail side of a master-detail relationship. A cross-object
formula also works with lookup relationships

59)In which automation tool can we delete the record


ANS:- Flow

60)What is mean by Governer Limit


ANS:- 1)Salesforce governor Limits are a concept that exists because Salesforce and Apex run in
a multitenant environment
2)Simply put, Salesforce Governor Limits are usage caps enforced by Salesforce to
ensure efficient processing. They allow for multiple users of the platform without
impeding performance.
61)Salesforce Architexture
ANS:-Salesforce Architecture is the multilayer architecture; it contains a series of layers situated on the
top of each other. In the multilayer salesforce architecture, the users are at the topmost layer
1)Application- Consistant and powerful Funtionality
2)Platform:- Data service artical intellegence and Api
3) salesforce:- trusted and multitenant cloud

62)What is Lead Assignment Rule


ANS:-Lead assignment rules can assign leads regardless of whether leads are created manually,
are generated from Web-to-Lead forms, or are imported using the Data Import Wizard

63)What is Web to case and web to lead


ANS:-Web-to-Lead or Web-to-Case functions are tools that automatically capture leads or cases
from a website external to Salesforce to create a lead or case record directly in Salesforce. These
tools are used to generate a Webform in HTML format with the Salesforce fields that retrieve the
information from the record

64)Diffrance between workflow and Process Builder?

ANS:-Process Builder and Workflows both tools are used to automate business processes.

Process Builder is more advanced than workflows. It extends upon the things that workflow does.

The major difference between workflows and process builder is the number of operations or actions they have.

Actions of Process builder:-

Create a new record


Update any related record
Quick action to create a record, update a record or log a call
Launch a flow
Send an email
Post to Chatter
Submit for approval
Call Apex methods

But the process builder doesn’t support outbound messages.

Workflows enable us to set up rules that are evaluated and the corresponding action is executed based on the type of change
in record.

Actions of workflows:-

Create Task
Update Field
Email Alert
Outbound Message

Process Builder brings a visual designer with it. Whereas the visual designer is not available in Workflows.

For updating related records, Process Builder can update any field on any related record.

Whereas Workflows can only update some fields on a parent record of a Master-Detail relationship.

65)What is mean Flow?


ANS:-A flow is the part of Salesforce Flow that collects data and performs actions in your
Salesforce org or an external system. Salesforce Flow provides two types of flows: screen flows and
auto Launched flows. To automate a business process that collects data from people, use a screen flow

66)What is mean by reletion?


ANS:- An object relationship in Salesforce is a two-way association between two objects.
Relationships are created by creating custom relationship fields on an object. This is done so that when
users view records, they can also see and access related data

67)what type of reletion between account and contact object


ANS:-Account and contact have a lookup relationship. It is lookup because you can create a
contact without account. However it behaves weird –like master detail in business logics – when you
create a contact with account and you delete that account then contact will be also deleted

68)What is Campaign..?
ANS:-A Salesforce Campaign is a group of Leads and Contacts exposed to specific marketing
communication(s). It stores essential performance metrics and means salespeople can quickly see the
customers and prospects that received marketing activity

69)write down the syntax of list set and map and tell me about
the diffrance between them
Ans:- A list is an ordered collection of elements that are distinguished by their indices. List elements
can be of any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex
types.

A map is a collection of key-value pairs where each unique key maps to a single value. Keys and values
can be any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.

A set is an unordered collection of elements that do not contain any duplicates. Set elements can be of
any data type—primitive types, collections, sObjects, user-defined types, and built-in Apex types.

70)Whatever the query language in the salesforce like how many query
language in the salesforce
Ans:- There are two query language in salesforce
1) Soql
2) sosl

71)can we fetch data from two object in soql query


Ans:- Yes we can feth that data but they have in reletionship

72)What are the best practice while writting the trigger


Ans:- 1) one class one trigger
2)use bulkification
3)use handler class method
4)use soql and sosl in the for loop
5)do not write hard code in that trigger
6)use naming convention
7)use specific event which is need that trigger

73) What are the best practice while writting in test class
Ans:- 1)test class must have written @isTest
2)75% code coverage is required in the test class
3) one assert statement requird for one method
4) Avoid using hard code

74)What is Scratch org in LWC..?


ANS:- 1)Scratch org is a disposable Salesforce org used for development and
testing
2)Scratch org can be created for a maximum of 30 days after which scratch org
gets deactivated. The
default duration for Scratch org is 7 days.

75)How to communication between parent to Grand Parent..?


Ans:- communication between parent component to grand parent is Using Component event

76)What is Aura attribute..?


Ans:- aura:attribute describes an attribute available on an app, interface, component, or event.
Indicates whether the attribute can be used outside of its own namespace. Possible values are public
(default), and global , and private

77)If not use Finish method in Batch then what happen..?


Ans:- What will happen if I remove Finish method? Compile Error. It is mandatory. Class wont be saved
at all

78)How Execute method Works..?


Ans:-execute method will process 200 records at a time To do the required processing for
each chunk of data, use the execute method. This method is called for each batch of records
that you pass to it

79)Can we call Future method in batch apex..?


Ans:- we can't call future method from batch class. If you try to invoke a future method from
Batch/Future you will get the below error -

FATAL ERROR: Future method cant be called from future or Batch

80)Can we call batch apex in batch apex if yes then how to call it..?
Ans:- There are two ways in salesforce which are used to call the batch class from another batch class
are: Using Queueable Apex. Using the Finish method of Batch class

81)Batchable from future method can it will possible..?


Ans:- Yes, we can't call future method from batch class. Some restriction of the future method are: No
more than 50 method {Methods with the future annotation} calls per Apex invocation

82)Naming convention rule for trigger..?


Ans:- Naming conventions make the application easier to read and maintain
 camelCase : Each word in the middle of the respective phrase begins with a capital
letter. for example apexHours

83)What is Aura:Method..?
Ans:- Use to define amethod as part of a component's API. This enables you to
directly call a method in a component’s client-side controller instead of firing and
handling a component event. Using simplifies the code needed for a parent
component to call a method on a child component that it contains.

84)What is Runas method in apex(test class concept)..?


Ans:-The system method runAs enables you to write test methods that change the user
context to an existing user or a new user so that the user's record sharing is enforced. The
runAs method doesn't enforce user permissions or field-level permissions

85)can we schedule the dyanamic dashboard


Ans:- You can't schedule refreshes for dynamic dashboards. They must be refreshed manually.

86)Explain me the salesforce security model


Ans:- Layer 1: Object-level-security
Object-level access can be managed through two configurations, profiles and permission sets.

1.1 Profiles
In Salesforce, profiles control access to object-level and field-level security among other things like
apps, tabs, and so on.

Since Maria is a new employee, an admin needs to add John to the appropriate profile that has
access to sales apps and related objects to begin giving her access to Salesforce data.

1.2 Permission sets

Since John has a marketing background, let’s say she wants to access the Campaigns object to help
with marketing. The admin wants to give permission to access Campaigns just to John. This is where
permission sets come in. Permission sets are used to provide additional (usually special)
permissions to users who are already in a profile. In our case,an admin needs to create a permission
set that provides access to the Campaigns object and assign that permission set to Maria.

Notes about permission sets:

.
1.
 With permission sets, you can add and remove permissions to a small
subset of users at any time.
 You can add multiple permission sets to a given user.
 Use permission sets only when a subset of users need additional
permissions.
 If a lot of people in a profile need that permission, then create a custom
profile and add permission directly to that profile.
Layer 2: Field-level-security

Even if John has access to objects, she still needs access to individual fields of each object. In
Salesforce, profiles also control field-level access.

An admin can provide read and write permissions for individual fields. An admin can also set a field
to hidden, completely hiding the field to that user.

Layer 3: Record-level security

This is where record-level security comes in. Salesforce provides five ways to share records with
others and access others’ records.

Types of record-level security (also known as record sharing rules)

Types of Record level sharing permissions

3.1 Record-level-security: organization-wide sharing defaults

Organization-wide defaults (OWD) control the default behavior of how every record of a given
object (for example, Accounts) is accessed by users who do not own the record. For example:

If OWD for Accounts is Private, it means Maria can only see records she is a owner of.
If OWD for Accounts is Read/Write, it means anyone can read and update (but not delete) the
record
3.2 Record -level-security: role hierarchies

Record-level security lets you give users access to some object records, but not others. The owner
has full access to the record. In a hierarchy, users higher in the hierarchy always have the same
access to users below them in the hierarchy.
In our case, the admin needs to add Maria to the appropriate role within Maria’s user

3.3 Record-level-security: sharing rules

Sharing Rules for particular sets of users, to give them access to records they don’t own or can’t
normally see.

if John wants to share records with her peers in the service executive teams She can use sharing
rules.

3.4 Record-level-security: Apex managed sharing

If sharing rules and manual sharing don’t give you the control you need, you can use Apex
managed sharing. Apex managed sharing allows developers to programmatically share custom
objects. When you use Apex managed sharing to share a custom object, only users with the “Modify
All Data” permission can add or change the sharing on the custom object’s record, and the sharing
access is maintained across record owner changes

87)what are the disadvantage and advantage of cascading delete


Ans:- When parent record is delete then automatically child record will be deleted and
when user don’t have that child object permission so thats overriding sharing rule and this is
the dis advantageS

88)What is Aura Bundle?


Ans:- Component: UI for lightning component

controller.js: Contains client-side controller methods to handle events in the component.

helper.js: JavaScript functions that can be called from any JavaScript code in a component’s
bundle

style: Contains styles for the component.

design: File required for components used in Lightning App Builder, Lightning pages, or
Community Builder.

renderer: Client-side renderer to override default rendering for a component.

documentation: A description, sample code, and one or multiple references to example


components

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

89)what is data loader and import widzard…?


Ans:- There are many tools available when it comes to importing data into your Salesforce org. The two
most common tools are the Data Import Wizard, a tool available within Salesforce Setup, and the Data
Loader, an external tool provided by Salesforce that easily connects to your orgs.

90)What are decorator and what is use of these..?


Ans:- The Lightning Web Components programming model has three decorators that add functionality
to property or function. Decorators dynamically alter the functionality of a property or function. The
ability to create decorators is part of ECMAScript, but these three decorators are unique to Lightning
Web Components.

 @api: To expose a public property, decorate it with @api. Public properties define the API for a
component. An owner component that uses the component in its markup can access the component’s
public properties. Public properties are reactive. If the value of reactive property changes, the
component’s template rerenders any content that references the property.
 @track: To track a private property’s value and rerender a component when it changes,
decorate the property with @track. Tracked properties are also called private reactive properties.
 @wire: To read Salesforce data, Lightning web components use a reactive wire service. When
the wire service provisions data, the component rerenders. Components use @wire in their JavaScript
class to specify a wire adaptor or an Apex method.

91)What is Imparative method please explain..?

Ans:-To control when the method invocation occurs (for example, in response to clicking a button), call
the method imperatively. When you call a method imperatively, you receive only a single response.
Compare this behavior with @wire , which delegates control to the framework and results in a stream of
values being provisioned.

In the following scenarios, you must call an Apex method imperatively as opposed to using @wire .

 To call a method that isn’t annotated with cacheable=true , which includes any method that
inserts, updates, or deletes data.
 To control when the invocation occurs.
 To work with objects that aren’t supported by User Interface API, like Task and Event.
 To call a method from an ES6 module that doesn’t extend LightningElement

If an Apex method is marked with @AuraEnabled(cacheable=true), a client-side Lightning Data


Service cache is checked before issuing the network call to invoke the Apex method on the server.
However, Lightning Data Service doesn’t manage data provisioned by Apex. Therefore, to refresh stale
data, invoke the Apex method and then call getRecordNotifyChange() to update the Lightning Data
Service cache.

92)What type of CRM in market


Ans:- We have different types of CRM according to the changes in customer portfolios, speed of
business operations, requirement of handling large data, and the need of sharing information, resources,
and efforts jointly.
CRM systems are divided based on their prominent characteristics. There are four basic types of CRM
systems −

 Strategic CRM
 Operational CRM
 Analytical CRM
 Collaborative CRM

93)Why salesforce is mostely use..?


Ans:- You can quickly and easily make data-backed decisions about new customer segments you
want to target. Salesforce can also help you build connected brand journeys that adjust based on your
customer's interactions, and give them the most helpful personalized experience

94)What is Trigger.new and trigger.newmap..?


Ans:- Trigger.New

Trigger.New is a collection of records on the Object the trigger is running on. It is


similar to how a developer would use List i.e. Trigger.New on Case Object would be
similar to List<Case>.When the trigger runs on a specific object, then the record or
records upon which the insert, update or delete operation occurs are added to a
list which can be accessed easily by using Trigger.New.

Trigger.New can be used for all event types on a trigger.


 Before Insert
 Before Update
 After Insert
 After Update
 After Undelete

Example

trigger CaseTrigger on Case (before insert){


for(Case c: Trigger.New){ //iterate over list and do some action
c.Subject = 'This case is being updated by trigger logic.';
}
}
Trigger.NewMap

Trigger.NewMap extends on the Trigger.New where it contains the same records in


a Map instead of a List. The map contains the ID of the record and the entire
record.

It is similar to how a developer would use Map i.e. Trigger.NewMap on Case Object
would be similar to Map<Id, Case>. Trigger.NewMap allows a developer to select
specific records if needed.

Trigger.NewMap cannot be used in all Trigger events. It can only be used in the
following:

 After Insert
 Before Update
 After Update
 After Undelete

Example

The statement will run only 1 time and fetch subject of all Cases related to the
account records in the map:

trigger AccountTrigger on Account (After insert){ //use trigger.newmap to


get results in a single transaction
List<Case> cLst = [Select Subject from Case where AccountId
in :Trigger.NewMap.keySet()];

for(Case c: cLst ){
//iterate over list and do some action
c.Subject = 'This case is being updated by trigger logic.';
*other logic......
}
}
When to use Trigger.New vs Trigger.NewMap

Use trigger.new when you want to iterate over a list and especially if the records
haven’t committed to the database as you wouldn’t have the IDs of the records yet.
However, as we noted above, trigger.new can be used in most before and after
events.

In contrast, use trigger.newmap when you have a specific use case where you have
a need to get a specific record based on a known ID etc, if you wish to not process
all records in the list.

95)What is after undelete..?


Ans- The after undelete trigger event only works with recovered records—that is, records that were
deleted and then recovered from the Recycle Bin through the undelete DML statement.

96)What is Application event..?


Ans:- Application event are the event handle by any component no matter what relationship
between them but they should be inside single application.

97)What is diffrant between application event in aura and lWC..?


Ans:- 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

98)what is custom settings in salesforce..?


Ans:- Custom settings are similar to custom objects in that they let you customize org data. Unlike
custom objects, which have records based on them, custom settings let you utilize custom data sets
across your org. Custom settings also let you distinguish particular users or profiles based on custom
criteria

99) statement of query in salesforce..?


Ans:- Use the Salesforce Object Query Language (SOQL) to search your organization's
Salesforce data for specific information. SOQL is similar to the SELECT statement in the widely
used Structured Query Language (SQL) but is designed specifically for Salesforce data

100) What is assert equals in salesforce..?


Ans:- assertEquals() is used to validate two values are equal. Basically it is used in test method.
This method asserts that the first two arguments, x and y are the same, if they are not a runtime
exception is thrown

You might also like