Posts

Saleforce Interview Questions 8

Lightning: Q) What are lightning components? Ans .  The Lightning Component framework is a UI framework for developing web apps for mobile and desktop devices. It’s a modern framework for building single-page applications with dynamic, responsive user interfaces for Lightning Platform apps . Q) What are Aura components? Ans . Aura components are the self-contained and reusable units of an app. They represent a reusable section of the UI, and can range in granularity from a single line of text to an entire app.  These components are also known as the base Lightning components. You can assemble and configure components to form new components in an app. Components are rendered to produce HTML DOM elements within the browser. Q) What are Web components? Ans . Lightning Web Components uses core  Web Components  standards and provides only what’s necessary to perform well in browsers supported by Salesforce. Because it’s built on code that runs natively i...

Salesforce Q&A Part 7:

Apex Test  Q)Why use test class in salesforce? Ans.  Test class is important to check the sanity and sole purpose of custom apex code written for organization. Apex code having minimum 75% of test class coverage is considered healthy apex code.  Q)How will the salesforce compiler knows you are writing a test class? Ans.  Using @isTest annotation and static testmethod() are two things. Q)How to make the private variable and methods visible? Ans.  Using @testVisible annotation. Q)What are the lines present in main code that are ignored in test class. Ans.  System.debug statements. Q)How can we run the test class for particular user? Ans.  using system.runAs(userProfile/username) Q) How to test asynchronous apex? Ans.  Using Test.start?() and Test.stop(). Q) How do you write test class for web-service class? Ans. Define a mock test  class implementing WebserviceMock interface for SOAP. and  StaticResourceCalloutM...

Salesforce Q&A Part 6:

Visualforce Q&A: Q) Mention the components used by you in normal VF pages. Ans. The following components were used in my VF pages. <apex:page/> <apex:pageBlock/> <apex:pageBlockSection/> <apex:pageBlockTable/> <apex:repeat/> <apex:commandButton/> <apex:commandLink/> <apex:includeScript /> <apex:inputField. /> <apex:outputLabel/field/panel  /> etc. Q) Difference between PageTable and Data Table. Ans.  PageBlockTable DataTable It must be defined in pageblock/pageblocksection. Anywhere in the page. standard styles sheets can be used for designing a VF page. custom style sheets can be used. It has the  required attribute "value". There is no required value. Column headers  will be displayed automatically. Need to specify column headers explicitly. Q) What are the controllers used in Vf page? Ans. Standard controll...

Salesforce Q&A Part 5:

Customization Part 1: Trigger: Q)   Explain Trigger and its flow. Ans . Apex Triggers are event handlers. When a record associated with the trigger is inserted, updated, deleted, or un-deleted the Salesforce.com system will "fire" or execute the trigger event.  Salesforce executes a trigger in two different contexts: before and after.  Before-trigger events are executed before a record has been committed to the database, while after-trigger events are executed after a record is committed to the database.  Events before/after(insert, update, delete) and after un-delete. Events helps in defining the criteria for trigger to run.  Within the scope of trigger we define the Trigger context variable like isInsert, isUpdate, isDelete, isUndelete, isAfter, isBefore, isExecuting, new, newMap, old, oldMap and size.  With deceive context variable we call for helper classes and pass the parameter to those classes(all logic implementation is carried ...

Salesforce Q&A Part 4:

Customisation Q&A Continued: Q)   How can we perform a 'callout' using  javascript button? Ans. Old Way : button logic {!REQUIRESCRIPT("/soap/ajax/30.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/30.0/apex.js")} if({!AAA__c.Name}!=Null) {     sforce.apex.execute("MyClass","myMethod",{}"});     alert("This is {!AAA__c.Name}"); } Apex class logic: global class MyClass {     webservice static void myMethod() // you can pass parameters     {          // Do something     } } New Way: Create visualforce button as javascript button is incompatible in SF1 and Lightning. <apex:page standardController="Case" extensions="EscalCase" action="{!caseEscalation}"> <apex:form> <apex:inputHidden value="{!case.OwnerId}"/> </apex:form> </apex:page> Apex: public class EscalCase {     //Apex properties or variables     public Id ow...

Salesforce Q&A Part 3:

Q) What are the automation tool in salesforce? Ans . Approvals, Process Builder, Workflow, and Visual Workflow. Q) What is a process builder? Ans. A process builder is a workflow tool with improved functionality to improve business processes. It provides user friendly graphical representation (like a flow chat)to build process. Process builder is easy  to create using point and click  efficiency and design entire process at one place rather than creating several workflow. Process builder is a mighty tool for Admins to create small automation without using any apex code. It can be designed by collaborating with different teams also. A process builder can be configured in three types: 1. Criteria that determine when to execute Action group. 2. Immediate action on meeting the criteria. 3. Scheduled action on meeting criteria.(not for in-vocable processes) Process Builder perform the same actions as workflow except for outbound messages. But with the Process Build...

Salesforce Q&A Part 2:

Configuration Continued: Q) What are the different ways of sharing a record with an user in Salesforce? Ans.   OWD, Profile, Role, Permission settings. Q)   What is sharing rule in Salesforce? Ans.   S haring rules are used to extend sharing access to users in public groups, roles, or territories . The access can be both Read only/Read Write access. Q) Can we override OWD? Ans. Yes, it is overridden whenever you declare a permission set or create a sharing rule. Sharing rules create automatic exceptions to OWD to provide greater access to user(s). Q)   What is a validation rule and why we use it? Ans. Validation rule validate data entered by user or a program to salesforce record. it is used to improve and maintain data quality. Q) What is the return type of validation rule? Ans. Formula or Expression returns Boolean. Q) When does a validation rule display an error message? Ans.  Expression/Formula returns True. Q) Methods/Proce...