Gravity Forms and Salesforce Integrations
Dec12

Gravity Forms and Salesforce Integrations

Gravity forms are generally the WordPress plugins to create a contact form. It allows site owners to create and gather the information. GRAVITY FORMS + SALESFORCE It forms a great combination to gather the information and add leads to Salesforce automatically. It helps making CRM more easy and simple. To set up it takes few minutes and provide you a way to collect information with much simplicity.  Gravity forms are much more interactive and provides you with easy way to add fields, making them mandatory, email etc. If you already don’t have this plugin installed then get it and make your work much easier. WEB FORMS to SALESFORCE We have several apps which does somthing similar on the context of getting your data drom a Web Form into Salesforce. Ex:- Web2Anything:- http://developer.force.com/codeshare/projectpage?id=a0630000003JS9MAAW formyoula:- https://formyoula.squarespace.com/ Salesforce.com Sites Pages:- You will have to custom build the vfpage with form and make it a publicly accessible URL. INTEGRATION To integrate your Gravity Forms with Salesforce follow the steps below: Go to setup in your Salesforce Org. and type web-to-lead in Quick Find box.                Generate new form. The redirect URL should be the URL where you want your page to be redirected after the submission of the form.   Select the fields you require in your Gravity Form and save the HTML code generated through it.               SYNC YOUR WEB-TO-LEAD FORM WITH GRAVITY FORMS Create your web-to-lead form as described above Look for the Salesforce Add-on tab(Form<Settings) and select Integration Method as Web-to-Lead. Update Settings.   Create your Gravity Form in your WordPress Site.                Add the fields you used while creating your web-to-lead form Save the form. Click the Gravity Form’s name and lookup for the confirmation tab under the settings. Select confirmation tab to redirect Redirect URL should be the URL you got while generating the web-to-lead form.     The URL should not include the “?encoding=UTF-8” since Gravity form do it itself on start of the query string. Check “Pass Field Data Via Query String” Your screen should look like this:       NOTE:  If you are trying to work in your sandbox then do change the Redirect URL to test.salesforce.com instead of www.salesforce.com since web-to-lead form generates form working in Production. Remember you removed “?encoding=UTF-8” from the redirect URL, now make this the first line of your Query String. Start with your oid and retURL to process our Query string. Each value should use “&” in between.   Now it’s time to map your salesforce fields to that of the gravity form you created. Build your query string in the following format:                field_name=field_value&2nd_field_name=2nd_field_value You can take help from...

Read More
Wave Dashboards in Lightning Pages
Nov25

Wave Dashboards in Lightning Pages

A Wave Dashboard is a collection of widgets that work together to tell a data story from multiple angles. Depending on what you want the dashboard to show or how to behave, you can add different widgets, such as key performance indicators, charts, tables, filters, and images.Embedding Wave Analytics Dashboard component to a Lightning homepage or record page can provide interactive visualization of your data. It is currently available in Lightning experience only. It offers additional features to help you build Dashboards more quickly and easily. Use a template to create a Dashboard with a predefined layout. Create customized layouts to optimize the display of a Dashboard on different types of devices, like mobile phones, tablets, and desktops. Use the wizards to quickly build widgets. Use drag-and-drop, snap-to-grid, and browser reflow to effortlessly add, position, and align widgets in a Dashboard. To add a Dashboard to your Lightning Page follow the steps below:   Select Wave Dashboard Component in the Lightning App Builder From the Dashboard drop-down list, select the Dashboard to display From the layout drop-down list, select the type of screen where your Lightning page will be viewed Configure following attributes of the Wave Analytics Dashboard:  Show Sharing Icon option lets you include Share icon on the Dashboard. If the icon is present, users can click to open the Share dialog, where they can post to Chatter and download images and data Show Title checkbox gives you control over the visibility of the Dashboard title Open Links in New Windows attribute, you can specify where links from the Dashboards to other assets are opened Hide On Error checkbox gives you control over whether the Wave Analytics Dashboard appears if there is an error Filter attribute, you can use JSON to filter dataset fields at run...

Read More
Salesforce Metadata API
Aug23

Salesforce Metadata API

What is Metadata ? First you need to understand data. What is data in context with Salesforce. Data is anything which is stored in a database like records related to Contacts,  Accounts, Leads Opportunity etc. Metadata : Metadata can be defined as the set of data about another data. i.e., Configuration/Code/Logic of the underlying structure which is used to store the data (Records). Another definition is you can say the database structure in which you will be saving the data.  Metadata Api for Salesforce can do several things programmatically. Some of the tasks are mentioned below: You can read, create, update, delete following components in a Salesforce organization. Custom Objects/Fields. Visualforce pages. Page Layouts. Validation rules. Apex. Workflows. Approval processes. Profiles. Reports etc. Security.                   You can configure a Salesforce organization just by running a piece of code. It means that you can create Objects,Fields,Validation,Workflows, Profiles, Reports for a particular client organization just by running the piece of code so that you need not do all the customisation settings manually which will consume time if you have to do that several times for different clients for the same configuration settings. You can also take the backup of your organization customisation settings just by fetching the metadata WSDL from your Salesforce org. For this You need to click setup>type API-Click on API >Click Generate metadata WSDL and download the xml file. There are two types of Metadata Api calls: Synchronous – This will give the result immediately as soon as you call a method. Asynchronous – This will not give result immediately, it will take time. Asynchronous : There are four types of methods which we can use: Create();   Update(); Upsert(); Delete(); We will discuss only for synchronous method. Synchronous : There are five types of methods which we can use: (i) createMetadata(); saveResult[] = metadataConnection.createMetadata(Metadata[] metadata); (ii) readMetadata(); readResult = metadataConnection.readMetadata(string metadataType, string[] fullNames); (iii)updateMetadata(); saveResult[] = metadataConnection.updateMetadata(Metadata[] metadata); (iv)upsertMetadata(); spsertResult[] = metadataConnection.upsertMetadata(Metadata[] metadata); (v)deleteMetadata(); seleteResult[] = metadataConnection.delete(string metadataType, string[] fullNames); All these classes saveResult, readResult, upsertResult, deleteResult comes from a main class that is MetadataService.cls in which all the relevant methods are present to function Read, Create, Update, Upsert or Delete properly. Now I will demonstrate how to create Custom components. You can use following methods to create components: (A) To Create a Custom Object: You need to add this code to your class which you are using and call this method via class name to create the object. Note: MetadataService is also a class which have several methods and used in these methods. Create a Custom Object: public static void createObject() {  ...

Read More
Day 4 Assignment (VFpage, JavaScript)
Jan26

Day 4 Assignment (VFpage, JavaScript)

I have created a 5 Days Salesforce based programming and configuration assignments for practice and improving your skills. This blog have the third day assignment. Since all the blogs are related I would recommend beginners to start from Day 2 assignment and not directly jump to this blog.     Requirement: We have a university “St Judes” which wants its salesforce account to get configured by us. Following are the requirement of this client.  1. Create a VF page listing a quick search for all the Professors. A quick search will be a on key press VF page. If the users press “V” in the field all the professors with starting name “V” like Vineet, Vinay .. etc will list down in the page. AJAX Toolkit Developer Guide SOLUTION: VisualForce Page Visual force page code. <apex:page id="page" controller="Basic2SearchProfessorsDynamically" sidebar="false"> <apex:form id="form"> <apex:pageMessages id="errors" /> <apex:pageBlock title="Find Me A Professor!" mode="edit" id="block"> <table width="100%" border="0"> <tr> <td width="200" valign="top"> <apex:pageBlock title="Parameters" mode="edit" id="criteria"> <script type="text/javascript"> function doSearch() { searchServer(document.getElementById("profName").value, document.getElementById("mail").value, document.getElementById("YOE").value ); } </script> <apex:actionFunction name="searchServer" action="{!runSearch}" reRender="results,errors,debug"> <apex:param name="profName" value="" /> <apex:param name="mail" value="" /> <apex:param name="YOE" value="" /> </apex:actionFunction> <table cellpadding="2" cellspacing="2" id="table"> <tr> <td style="font-weight:bold;">Name<br /> <input type="text" id="profName" onkeyup="doSearch();" /> </td> </tr> <tr> <td style="font-weight:bold;">Email<br /> <input type="text" id="mail" onkeyup="doSearch();" /> </td> </tr> <tr> <td style="font-weight:bold;">Year Of Experience<br /> <input type="text" id="YOE" onkeyup="doSearch();" /> </td> </tr> </table> </apex:pageBlock> </td> <td valign="top"> <apex:pageBlock mode="edit" id="results"> <apex:outputPanel id="panel" rendered="true"> <apex:pageBlockTable value="{!profList}" var="prof"> <apex:variable value="{!0}" var="cnt"/> <apex:column headerValue="Action"> <apex:commandButton value="Delete" style="background: red; color: white;" action="{!deleteProf}" rendered="true" reRender="panel"> <apex:param value="{!prof.Id}" name="profToRemove" assignTo="{!rowToRemove}"/> <apex:param name="index" value="{!cnt}"/> </apex:commandButton> <apex:variable var="cnt" value="{!cnt+1}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Professor Name" action="{!toggleSort}" reRender="results"> <apex:param name="sortField" value="Name" assignTo="{!sortField}" /> </apex:commandLink> </apex:facet> <apex:outputField value="{!prof.Name}" /> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Professor Email" action="{!toggleSort}" reRender="results"> <apex:param name="sortField" value="Email__c" assignTo="{!sortField}" /> </apex:commandLink> </apex:facet> <apex:outputField value="{!prof.Email__c}" /> </apex:column> <apex:column > <apex:facet name="header"> <apex:commandLink value="Year of Experience" action="{!toggleSort}" reRender="results"> <apex:param name="sortField" value="Year_Of_Experience__c" assignTo="{!sortField}" /> </apex:commandLink> </apex:facet> <apex:outputField value="{!prof.Year_Of_Experience__c}" /> </apex:column> </apex:pageBlockTable> </apex:outputPanel> </apex:pageBlock> </td> </tr> </table> <apex:pageBlock title="Debug - SOQL" id="debug"> <apex:outputText value="{!debugSoql}" /> </apex:pageBlock> </apex:pageBlock> </apex:form> </apex:page> 2. The quick search will have a delete button beside each Professor row. This will delete a particular Professor. Once the Professor is deleted all the students from the Professors Course will get de-enrolled(Removed)  SOLUTION: VisualForce Page Controller public with sharing class Basic2SearchProfessorsDynamically { //the soql without the order and limit private String soql {get; set;} //the row to be delete public String rowToRemove{get; set;} //the collection of professors to display public List<Basic2Proffessor__c> profList {get; set;} //Required Professor(Dummy Professor) Basic2Proffessor__c reqProf = [SELECT Id, Name FROM Basic2Proffessor__c WHERE Name = ‘Professor Required’]; //the current sort direction. default...

Read More