Posts

Clone with Related list

Image
The standard clone button provided by Salesforce does not have the capability to clone the related list records. So I thought of creating a custom button which will clone the parent record along with the related list records up-to one level deep. For example, you can clone Account with Contacts or Opportunities with Quotes or any standard or custom object. This app also provides you the ability to select which object's child records you want to clone. Code is uploaded @  GitHub Repo Follow below steps to make it working on your Salesforce org : 1) Copy the classes and VF page from GitHub to your Salesforce org. 2) Create a button named "Clone with Related List"  on the object you want to clone. I will take the example of Account. Behavior of the button should be "Execute JavaScript" and Content Source should be "OnClick JavaScript" 3) Copy below code for the button : {!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}  window.ope...

Spring 16 - New features

Image
Spring 16 new features : Health Check : Do you know how secure your org is? Are you following the best security practices recommended by Salesforce? With the new Health check feature introduced in Spring 16, you can visually see how Salesforce has rated your org as per the current implementation present in it. If you are a security administrator, this tool will make your life much more easier. To check the health score, click on Setup and type Health check is the Quick Search Bar. Click on Health Check and a report is displayed which lists out the health score of your org and the potential risk factors. The risk factors are classified as : 1) High Risk Security Settings 2) Medium Risk Security Settings 3) Low Risk Security Settings Most of the security breaches are around the password requirements and password policies. Global Picklist :  Ever felt a need to share common picklist values across multiple objects? Tired of recreating the same picklist values o...

Custom clone button in salesforce

Image
Custom clone button Ever faced a situation where you need to create a custom clone button. For example, you want to clone a lead record and you have a check-box on lead which you do not want to copy on the new record. In this article, we will see how to create a custom clone button. Use case : User wants to clone the lead record. There is a check-box on lead called "Data migrated record" whose value should not be copied. Step 1) Create a custom detail page button. Step 2) Put following url for the button created in step 1 : /{!Lead.Id}/e?clone=1&retURL=%2F{!Lead.Id}&00N9000000E9daG=false Let us analyse this url : a) {!Lead.Id} : Id of the original record from which new record has been cloned. b) clone=1 : url parameter which copies the value from original record to new record c) retURL=%2F{!Lead.Id} : specifies the page which should be opened when Cancel button is clicked d) 00N9000000E9daG=false : This is the id of check-box named "Data migra...

ActionFunction and ActionSupport in Salesforce - When to use what?

Most of the newbies in Salesforce are confused regarding the usage of <apex:actionSupport> and <apex:actionFunction> tags. Lets take a brief overview about what they are and when to use what. <apex:actionSupport> - This component is used when you want to provide AJAX support to a another component. For example, on click of an image , we need to call an apex function. So, in between start tag and end tag of our image, we can put an action support component. We need to specify the javascript event, for example onclick event and the apex action which needs  to be called when this event happens.  <apex:page controller="ActionController">   <apex:form >       <apex:image url="https://login.salesforce.com/img/logo190.png">           <apex:actionSupport action="{!methodInApex}" event="onclick"/>       </apex:image>   </apex:form> </apex:page> ...

Summer 15 Release Notes - Some exciting features

Here are some of the important features released in Summer 15 Release : Salesforce Lightning Lightning App builder is GA in summer 15 release. Lightning App are single page apps which are composed of Lightning pages. Lightning pages are responsive designed pages which consists of lightning components. 5 Standard components provided in this release - Filter, List, Recent Items, Report Charts, Rich Text and Visualforce page. Lightning connect Apex connector : Extend Lightning connect through apex code, access external data as you access any sObject present in your org. This will be useful where oData is not supported as a protocol. When you connect any external data source and subscribe to its data, an equivalent external object in created in your Salesforce organization. Currently you can access the data in read only mode and you cannot create reports and dashboards on external objects. We hope to get the reporting feature in next release from Salesforce. Lightning connect Sal...

Search Nearby Places

Image
Overview of the application This application will read user's current location and based on user's input, it will display nearby places like ATM's, Banks, Restaurants, Hospitals etc. Below languages have been used in this app : HTML 5.0 to read user's current location (latitude and longitude). Javascript to get user's current address from his current location (latitude and longitude). Javascript and Visualforce to display user's current location on google maps. Apex: REST call to Google's nearby places API to get nearby places within a specified range. You can host this application on a Force.com site so that it can be accessed publicly. Code is uploaded @ GitHub Repo Steps to register for Google API Key :    Log in to the following URL using google account:         https://console.developers.google.com/project   Create a new project. Click on project, go to Api's (under APIs and auth). ...