Posts

Showing posts from February, 2018

Inline Edit And Custom Lightning Components

Image
Inline Editing lets users quickly edit field values, right on a record's detail pages. Below are the Custom Lightning Components support Inline Editing. Apex Controller: public class InlineEditController {      @AuraEnabled     public static List <account> fetchAccount() {         List <Account> lstOfAccount = [select id, Name, Rating, website from account LIMIT 5];         return lstOfAccount;     }     @AuraEnabled     public static List <account> saveAccount(List<Account> lstAccount) {         update lstAccount;         return lstAccount;     }     @AuraEnabled     public static List < String > getselectOptions(sObject objObject, string fld) {         system.debug('objObject --->' + objObject);         system.debug('fld --->' + fld);         List < String > allOpts = new list < String > ();         Schema.sObjectType objType = objObject.getSObjectType();         Schema.DescribeSObjectResult ob

Salesforce Lightning ListView Component With Horizontal and Vertical Scrollbar

Image
ListView Allows you to see a filtered list of records such as Accounts, Contacts or Custom Objects. Here is the Custom Lightning Component that displays a list of records with specified fields. We can also add scrollbar by using Lightning Design System-Scrollable (make a containing box scrollable when scrolling is available). Apex Controller: public class CustomListViewController {     @AuraEnabled         public static List<Account> accountListView(){          List<Account> accountList= [Select Name,AccountNumber,Site,AccountSource,Active__c,AnnualRevenue,CleanStatus,common1__c,common2__c,Concatinate__c from Account];         return accountList;         } } Lightning Component: <aura:component Controller="CustomListViewController" implements="force:appHostable,flexipage:availableForAllPageTypes">     <aura:attribute name="account" Type="Account" />     <aura:handler name="init" value="{!

Create Records Using Lightning Components

Image
In this post, we will focus on how to create records of any SObject Type(SObject can be Standard and Custom) using Lightning Component. Lightning Component: <aura:component controller="CreateAnAccount"                 implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,                             force:hasRecordId,forceCommunity:availableForAllPageTypes"                 access="global" >       <ltng:require styles="/resource/bootstrap/css/bootstrap.min.css"                   scripts="/resource/bootstrap/js/jquery.js,/resource/bootstrap/js/bootstrap.min.js"/>     <aura:attribute name="account" type="Account" default="{'sobjectType': 'Account',                                                            'Name': '',                                                            'AccountNumber': '',

Integrating Visualforce And GoogleCharts

Image
Google Charts is a very powerful, free javascript library that can be used to produce a wide variety of colorful and useful charts, from pie charts to histograms. Combined with Visuaforce, the  Google Charts can offer more flexibility and distribution potential than using a dashboard. Since the charts are generated through a URL, the visualizations can be shared and embedded wherever images are permitted. In this post, we will focus on combining Visualforce to Google Charts.Below is an example, Visualforce Page: <apex:page controller="Goal" sidebar="true" showHeader="true" showChat="true">      <apex:includeScript id="a" value="https://www.google.com/jsapi" />     <div id="chartBlock" />     <script type="text/javascript">     google.load('visualization', '1.0', {'packages':['corechart']});     google.setOnLoadCallback(initCharts);     func