Saturday, September 23, 2023
HomeUncategorizedSalesforce Interview Query – Half 2

Salesforce Interview Query – Half 2


1. What’s an interface in apex?

Ans. An interface is like an Apex class wherein not one of the strategies has been applied. It solely comprises the tactic signatures, however the physique of every methodology is empty.

For e.g

world class ScheduleUpdate implements Schedulable{
    world void execute(SchedulableContext SC){}

2. What’s using @Api within the Lightning internet part?

Ans. It’s used to show a variable or capabilities publically and make properties reactive.

3. What’s the syntax of Schedulable class?

Syntax of schedulable class:

world class ScheduleUpdate implements Schedulable
    world void execute(SchedulableContext sc) {
        // Implement any logic to be scheduled
        // We now name the batch class to be scheduled BatchContactUpdate b = new BatchContactUpdate ();
        //Parameters of ExecuteBatch(context,BatchSize) database.executebatch(b,200);

4. How can I resolve the combined DML Error?

Ans. When the combined DML Error is getting then we have to resolve this error utilizing a future methodology or name asynchronously as a result of this error will present after we carry out an operation between the setup of the non-setup object.

5. What’s the strategy of deployment?

Ans. Technique of Deployment -> To deploy the modifications from sandbox to prodction utilizing change set.
For extra learn about deployment, please observe this hyperlink: Deployment Process in Salesforce

6. What’s the sandbox and the kind of sandbox?

Ans. A sandbox is a replica of the manufacturing atmosphere/org, used for testing and improvement functions.
Forms of Sandboxes are:

  • Developer
  • Developer Professional
  • Partial Copy
  • Full

For extra study in regards to the sandbox, please observe this hyperlink: Sandbox Tutorial

dont miss out iconTry the Salesforce Interview Question – Part 1 – HERE!

7. When can we use @TestVisible within the take a look at class?

Ans. Use the TestVisible annotation to permit take a look at strategies to entry non-public or protected members of one other class exterior the take a look at class. These members embrace strategies, member variables, and internal lessons. This annotation allows a extra permissive entry degree for operating assessments solely.

8. Are you able to edit an apex set off/apex class in a manufacturing atmosphere? Are you able to edit a Visualforce web page in manufacturing atmosphere?

Ans. No, it isn’t attainable to edit apex lessons and triggers immediately in a manufacturing atmosphere.

9. Distinction between Function and Profile?

Function Profile
The position helps in defining information visibility for a specific consumer. A profile units the limitation for what an consumer can do within the group.
Based mostly on the hierarchy, a job defines which consumer information a consumer can see. Profile defines permissions
Defining position to a consumer isn’t obligatory Defining profile is obligatory
Roles present a function to regulate entry to information by impacting experiences. Profiles assist to determine document privileges.

10. The way to optimize your code?

  • Keep away from SOQL Queries or DML statements inside FOR Loops
  • Cumbersome/triggers your Code
  • Cumbersome your Helper Strategies
  • Utilizing Collections, Streamlining Queries, and Environment friendly for Loops (Use maps and keep away from nested for/do-while loops)
  • Feedback, a number of feedback to simple comprehensible every other developer
  • Use of the Limits Apex Strategies to Keep away from Hitting Governor Limits

11. What varieties of operations might be carried out on a number of objects in a single DML assertion?

You possibly can carry out the next operations on a number of objects in a single DML assertion:


12. Why ought to we keep away from SOQL queries inside FOR loops?

Ans. One of many foremost causes to keep away from SOQL queries inside FOR loops is as a result of

  • it might result in governor limits being reached.
  • This may trigger your code to fail and might trigger efficiency points. Moreover, it might make your code harder to learn and keep.

13. What are the other ways of invoking Apex strategies?

Ans. There are 4 methods of invoking Apex strategies: from a Visualforce web page, from an Apex controller or extension, from a set off, or from a category that implements an interface.

14. What kind of exception might be thrown as a part of a set off invocation?

Ans. A set off can throw a System.Exception, which incorporates quite a lot of several types of exceptions, akin to DmlException, QueryException, and EmailException.

15. What number of triggers might be related to an object in Salesforce?

Ans. There might be as much as 10 triggers related to an object in Salesforce.

dont miss out iconRemember to take a look at: LWC Interview Questions -1 ( Freshers)

16. What are totally different kind of Triggers?

Ans. There are two varieties of triggers:

  • Earlier than triggers are used to carry out a activity earlier than a document is inserted or up to date or deleted. These are used to replace or validate document values earlier than they’re saved
    to the database.
  • After triggers are used if we wish to use the knowledge set by Salesforce system and to make modifications within the different information. are used to entry discipline values which might be set by the system (akin to a document’s Id or LastModifiedDate discipline), and to have an effect on modifications in different information. The information that fireplace the after set off are read-only.

17. What do you perceive about workflow in Salesforce?

Workflow permits automation of ordinary inner processes for saving time throughout a company. It helps in evaluating information as they’re created or up to date. It additionally determines whether or not an automatic motion should happen, akin to capabilities like follow-up emails, advertising actions, monitoring the shopper map journey, and extra.

A workflow rule is a container for numerous workflow directions, normally summed up in an if/then assertion.

18. What’s Apex in Salesforce?

Apex is a strongly typed OOP language that enables builders to execute transaction management statements and circulation on Salesforce platform servers along side calls to the API. Its syntax is much like Java and serves as database saved procedures. The code might be initiated through triggers on objects and requests from internet companies, they usually run on the Lightning platform.

Apex allows builders to include enterprise logic to system occasions, together with button clicks, Visualforce pages, and associated document updates.

19. What’s the distinction between public and world?

The general public entry modifier declares that this class is seen in your software or namespace. The worldwide entry modifier declares that this class is thought by all Apex code in all places

20. What’s the distinction between Aura and LWC?

There’s a explicit distinction between Aura and LWC. The LWC-based lightning part is constructed utilizing internet stack instruments, whereas the aura-based lightning elements are constructed utilizing HTML5 and JavaScript instruments.

21. What are lifecycle hooks in LWC ?

Ans: A lifecycle hook is a callback methodology triggered at a particular part of a part occasion’s lifecycle.

There are following hooks supported in LWC :

Constructor : Referred to as when the part is created.

Connectedcallback : Referred to as when the factor is inserted right into a doc. This hook flows from mother or father to little one.

RenderedCallback : Referred to as after each render of the part. This lifecycle hook is restricted to Lightning Internet Parts, it isn’t from the HTML customized parts specification. This hook flows from little one to mother or father. Ie its not a part of HTMLElement fairly outlined in LightningElement.

Disconnectedcallback : Referred to as when the factor is faraway from a doc. This hook flows from mother or father to little one.

Errorcallback  : Referred to as when a descendant part throws an error. The error argument is a JavaScript native error object, and the stack argument is a string. This lifecycle hook is restricted to Lightning Internet Parts, it isn’t from the HTML customized parts specification

22. How can name the Batchable class utilizing future Strategies?

Ans. Database.execute(BatchableClass, 200);

23. What’s the Order of Execution in LWC?

  • constructor
  • wire
  • connectedCallback
  • render
  • renderedCallback
  • wire
  • render
  • renderedCallback

24. What’s the distinction Between Esclation Rule and Project Rule?

Ans. Project Guidelines applies for leads or circumstances. Escalation Guidelines applies for circumstances.

25. What’s the Asynchronous Apex?

Ans. Asynchronous Apex is used to run processes in a separate thread, at a later time. An asynchronous course of is a course of or perform that executes a activity “within the background” with out the consumer having to attend for the duty to complete.

26. What’s the Validation Rule?

A validation rule is one strategy to limit enter in a desk discipline or a management (akin to a textual content field) on a type. Validation textual content helps you to present a message to assist customers who enter information that’s not legitimate.

dont miss out iconTry one other superb weblog by Aman right here: What is Enhanced Domain Security in Salesforce in 2023?

27. The way to get the Present Login Consumer?

Ans. To get the present login consumer utilizing this userinfo.getuserinfo();

28. What number of varieties of occasions in set off?


Salesforce Interview

29. What’s the Distinction Between set off.previous & set

Ans. Set off.New variable returns the listing of sObject which has invoked the set off and Set off.previous returns an inventory of the older variations of the information which have invoked the set off. Set off.Outdated is just accessible in replace and delete occasions.

30. What’s the Distinction Between set & set off.newMap?

Ans. Set off.New variable returns the listing of sObject which has invoked the set off and Set off.NewMap returns the map of ID’s with the newly entered information. NewMap is just accessible in after insert, earlier than and after the replace and after undelete


Source link



Please enter your comment!
Please enter your name here

- Advertisment -

Most Popular

Recent Comments