Skip to main content

Posts

Showing posts from April, 2020

Covid Status Tracker Single page Application using Salesforce Force.com Sites

Step1: Create Corona Cases Object with the below fields. State__c, State_Code__c, Confirmed__c, Active__c, Recovered__c, Deaths__c, Today_New_Cases__c, Today_Recovered__c, Today_Deaths__c, Last_Updated_Time__c Step2: Register the Open Source API site under Remote Site Settings Step3: Create a Callout class in Salesforce using REST API to call the Opensource API from  https://api.covid19india.org/data.json Callout Class: https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidInfoCallOuts.apxc JSON2APEX Class. https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidJson.apxc Sample JSON from Third-party Application. https://github.com/NagarjunaKaipu/myLightning/blob/master/ThirdpartyRESTAPIJson.json Step4: Create a Schedulable class to run the callout class in the frequent intervals. https://github.com/NagarjunaKaipu/myLightning/blob/master/ScheduleRefreshCovid.apxc Step5: Create Visualforce page to show the List of records on UI. VF p...

Create Covid Status Application in Salesforce using REST API

State wise Covid19 Status in India Step1: Create a Corona_Case__c object to create a record in Salesforce with below fields. State__c,  State_Code__c,  Confirmed__c,  Active__c,  Recovered__c,  Deaths__c,  Today_New_Cases__c,  Today_Recovered__c,  Today_Deaths__c,  Last_Updated_Time__c Step2: Create Remote Site Settings as shown below Step3: Create a REST Class to get the Covid19 Status in India using Open Source API. refer the below class from GitHub. https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidInfoCallOuts.apxc JSON2APEX Class. https://github.com/NagarjunaKaipu/myLightning/blob/master/CovidJson.apxc Sample JSON from Third-party Application. https://github.com/NagarjunaKaipu/myLightning/blob/master/ThirdpartyRESTAPIJson.json Step4: To display using Lightning Web Components. Create a Lightning Web Component to get the Covid19 status report. https://...

Display list of contacts using Lightning Datatable

Lightning datatable is a table that displays columns of data, formatted according to type. Important attributes includes data, columns, and keyField attributes.The keyField attribute is required for correct table behavior. It associates each row with a unique identifier. Component: ContactListDisplay.cmp Refer below link for the code on github https://github.com/NagarjunaKaipu/myLightning/blob/master/ContactListDisplay.cmp Client Side Controller: ContactListDisplayController.js ({ doInit : function (component, event, helper) { component. set ( "v.myColumns" ,[ {label: "Name" , fieldName: "Name" , type : "text" }, {label: "Title" , fieldName: "Title" , type : "text" }, {label: "Department" , fieldName: "Department" , type : "text" } ]); var conAction = component. get ( "c.getContacts" ); conAction.setCallb...