Wednesday, 24 February 2016



How to Update a field when a button is clicked on record level ?

Step 1.  Create  a custom button (name it as "Update Field") and select content source as  "Onclick Javascript "

Step 2 . Paste below code in it

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")} 

var newRecords = [];
var c = new sforce.SObject("Account"); 
c.id ="{!Account.Id}";
c.NumberofLocations__c = '400';
newRecords.push(c); 
result = sforce.connection.update(newRecords);
window.location.reload();

Note: - Here NumberofLocations__c is a custom field

Step 3 . Open any account record 
Before Clicking UpdateField Button 



After Clickling UpdateField Button 
You will find value of Number of locations is changed from 6 to 400 as below 

Tuesday, 16 February 2016



Salesforce Process Builder



The Process Builder is a workflow tool that helps you easily automate your business processes by providing a powerful and user-friendly graphical representation of your process as you build it. 

The new Lightning Process Builder has two main features that stand out. The first is the huge amount of functionality the new process builder brings with it. Before, a process that might have taken 10 separate workflows to accomplish with different outcomes now only has to have one process. This is because we can have true and false actions for a criteria, which can then have true and false actions coming off them again. In addition to having multiple outcomes, the amount of actions available have increased, so now, we can post to chatter, launch flows, update record and (this is the BIG one), we can create records. Taking it one step further, we can also default some fields for these automatically created records.


The second feature is how the Process Builder brings a visual designer with it. In the diagram below, see  how you can bring workflows together to create complex processes to automate time-consuming tasks. This makes “old school” workflows look a bit antiquated, especially when you are creating workflows that interact with one another to set off a chain-like reaction.




From the diagram above, you can see how processes can be built quickly and simply. We start at the top and work our way through the diagram to see which actions will be triggered by what criteria. If you follow through this simple flow diagram, you can see that we are working with an account, and the criteria I have chosen is Account Type (my actual criteria is Account Type = Prospect). You can also see that when this criteria is true, I have made an immediate action to create an Opportunity.



Clicking on this ‘Create Opportunity” tab will open up a separate area, where I can choose to default as many fields as I like. Then we can have similar actions if the criteria equals false, and then test another criteria, and so on.




Thursday, 11 February 2016



Difference Between Synchronous and Asynchronous Messages


Synchronous Messages

Synchronous messaging involves a client that waits for the server to respond to a message. Messages are able to flow in both directions, to and from. Essentially it means that synchronous messaging is a two way communication. i.e. Sender sends a message to receiver and receiver receives this message and gives reply to the sender. Sender will not send another message until get reply from receiver.

Asynchronous Messages


Asynchronous messaging involves a client that does not wait for a message from the server. An event is used to trigger a message from a server. So even if the client is down , the messaging will complete successfully. Asynchronous Messaging means that, it is a one way communication and the flow of communication is one way only.

Thursday, 4 February 2016





 How to delete an apex class or trigger from production org in salesforce

Steps :

Step 1: Open the sandbox org in force.com IDE(Eclipse).

Step 2: Open the matching .xml file of the class/trigger which we need to delete and change the status XML tag from "Active" to "Deleted".

Step 3: Save the file and then deploy the main class as well as associated .xml file to production.

Quick start with Salesforce Lightning components


Step 1: Sign up for a Developer Edition Environment


2. Fill out the form, noting the following:
a. Make sure to use an email address you can easily check right now.
b. The username is in the form of an email address, but it doesn’t have to be the same as your email address. your.name@DF14.com is a perfectly good username, even if it isn’t your actual email address.



Step 2: Create a Namespace

Every Lightning component is prefixed by a namespace, so the first thing you need to do is
register for a unique namespace.
1. Click Setup | Create | Packages and then click Edit.
2. Click Continue.
3. Type a namespace and then click Check Availability to see if it’s unique.
4. Click Review My Selections and then Save.

Step 3: Enable Lightning Components

1. From Setup, click Develop | Lightning Components.
2. Select the Enable Lightning Components checkbox and click Save.

Step 4: Create a Lightning App

Bundles are like folders that hold related files. The first bundle you’ll create is an
app bundle.
1. In your Developer Edition (DE) environment, Click <your_name> and then Developer
Console.
2. Select File | New | Lightning Application.
3. Name it HelloWorld and click Submit.

Step 5: Edit the App

1. If HelloWorld.app isn’t open, click APPLICATION in the sidebar.
2. Add some HTML, such as My First Lightning App!
     <aura:application>
            <h1>My first Lightning app!</h1>

    </aura:application>

3. Save the app.


Step 6: Test the App

In the Developer Console, click the Preview button on the sidebar to open the app.

Step 7: Create a Component

As you just saw, you can place markup directly inside the app. However, putting it in a
component allows you to reuse it across different apps.

1. Select File | New | Lightning Component.
2. Type hello and then click Submit.
3. Add the following code and then Save.
     <aura:component>
          <h1>Hello World!</h1>
      </aura:component>

Step 8: Embed the Component in the App

1. In the Developer Console, open HelloWorld.app.
2. Add code to use your hello component.
    <aura:application>
           <jam:hello />
     </aura:application>
3. Make sure to replace the jam namespace with your own namespace. Then Save.
4. Click the Preview button on the sidebar to view the updated app.



 Salesforce Interview Questions


1) What is the advantage of using custom setting?
Ans: You donot have to query in apex(fire select query) to retrieve the data stored in custom settings.

2) what is whoid and whatid in activities?

Ans: Whoid is the id of either contact or lead.Whatid is the id of the related to record in activiity record(standard or custom object).

3) what is the difference between  a standard controller and custom controller?

Ansstandard controller inherits all the standard object properties,standard button functionalities can be directly used.Custom controller defines custom functionalities,a standard controller can be extended to develop custom functionalities using keyword "extensions".

4) Can you have more than one extension associated with a single page?
Ans: Yes we can have more than one extension.

5) If page is having extensions and if two extensions have methods of same name.Then which method out of these two will be called from vf page?
Ans: The one which is present in the controller defined on the left side will be called.

6) What are governer limits?
Ans: Governer limits are the limits impossed by salesforce so as to avoid monopoly by orgs in using salesforce shared resources.

7) What is the difference between force.com and salesforce.com?
Ans: force.com is paas(platform as a service) and salesforce.com is Saas(Software as a service)

8) How many records can a select query return?
Ans: As of now,it can return upto 50000 records.

9) How many records can a sosl query return?

Ans: As of now it can return upto 2000 records.

10) How can you access custom label in visualforce page?
Ans: Use this syntax for accessing custom label in visualforce page - {!Label.LabelName} where LabelName is the name of Label.

11) How can you query all records(including deleted records) using an SOQL query?

Ans: Using ALL Rows Keyword.This will query all records including deleted records in recyclebin.
Eg:List <Account> accountList = [select id from account  ALL ROWS];

12) What is the use of @future annotation?

Ans: Using @future annotation with a method executes it whenever salesforce has resources available.

13) what is the significance of static keyword?
Ans: Methods,variables when defined as static are initialized only once when class is loaded.Static variables are not transmitted as part of view state for a visualforce page

14) Can custom setting be accessed in a test class?
Ans: Custom setting data is not available default in a test class.We have to set seeAllData parameter true while defining a test class as below
@isTest(seeAlldata=true).

15) what is the difference between role and profile?
Ans: Role defines record level access while profile defines object level access.

16) Through Sales force Import wizard how many records we can import?

Ans : Using Import wizard, we can upload up to 50000 records.

17) Import wizard will support for which Objects?

Ans : Only Accounts, Contacts, Leads, Solutions and custom object’s data can be imported.  If we want to import other objects like Opportunities and other object’s data, then we need to go for Apex Data Loader.

18)  What is app exchange?

Ans : The developed custom applications can be uploaded into the app exchange so that the other person can share the applicaition.

19) What is a VLOOKUP in S.F?

Ans : VLOOKUP is actually a function in sales force which is used to bring relevant value to that record from another record automatically.

20) When I want to export data into SF from Apex Data Loader, which Option should be enable in Profile?

Ans : Enable API

21) What is a web - lead?

Ans : Capturing a lead from a website and routing it into lead object in Sales Force is called wed-lead (web to lead).

22) What are the Types of Account and difference between them?

Ans : We have two types of accounts.
Personal accounts
Business accounts

In personal accounts, person’s name will be taken as primary considerations where as in business accounts, there will be no person name, but company name will be taken into consideration.

23) What is a Wrapper Class in S.F?

Ans : A wrapper class is a class whose instances are collections of other objects.

24) What are formula and Rollup Summary fields and Difference between them? When should Rollup- Summary field enable?

Ans : 
Formula: A read-only field that derives its value from a formula expression that we define. The formula field is updated when any of the source fields change.

Rollup Summary: A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list.

25) What is a Sandbox? What are all the Types of sandboxex?

Ans : Sandbox is the exact replica of the production.

4 Types:
Developer
Developer Pro
Partial Copy
Full Copy


 Difference between insert and Database.insert() 



Database.insert() :


                             Using the  Database.insert()  we can specify whether or not to allow for partial record processing if errors are encountered .

                              It means even though errors are present while doing insert/update/delete operation,if we use Database methods, process will continue .

insert :


           Using the Insert statement we can not specify whether or not to allow for partial record processing if errors are encountered .

              It means if errors are present while doing insert/update/delete operation,the process will get stopped and error is thrown away. 

Tools for Lightning Web Component Development

 Below are the tools required for Web Component Development 1. Chrome Browser (Prefered) You can download it from Google 2. Visual Studio Co...