Skip to content

Instantly share code, notes, and snippets.

View arun12209's full-sized avatar
🥑

Arun Kumar arun12209

🥑
View GitHub Profile
@arun12209
arun12209 / OpptyCloseTimerCmp
Created June 28, 2019 15:08
OpptyCloseTimerCmp
<aura:component controller="OpptyCloseTimerCntrl" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="second" type="string"/>
<aura:attribute name="minute" type="string"/>
<aura:attribute name="hour" type="string"/>
<aura:attribute name="day" type="string"/>
<aura:attribute name="msg" type="String"/>
<aura:attribute name="isValid" type="Boolean" default="false"/>
<div class="slds">
<div class="slds-page-header">
@arun12209
arun12209 / ViewAccountHeirarchyController
Created August 30, 2019 18:08
ViewAccountHeirarchyController
({
navigateToAccountHierarchy: function(cmp, event, helper) {
var acctId = cmp.get('v.recordId');
var evt = $A.get("e.force:navigateToComponent");
evt.setParams({
componentDef: "sfa:hierarchyFullView",
componentAttributes: {
recordId: acctId,
sObjectName: "Account"
}
@arun12209
arun12209 / ContentDocumentLink_Trigger
Last active May 30, 2020 07:42
ContentDocumentLink_Trigger
@arun12209
arun12209 / ContentDocumentLink_TriggerHelper
Created April 25, 2020 08:55
ContentDocumentLink_TriggerHelper
@arun12209
arun12209 / NEWSAPI_Callout
Created April 12, 2020 07:57
NEWSAPI_Callout
string baseURL='https://newsapi.org/v2/top-headlines';
String apiKey =''; //API key get it from Newsapi.org
HttpRequest reqest = new HttpRequest();
system.debug('EndPoint: '+baseURL+'?sources=national-geographic&apiKey='+apiKey);
reqest.setEndpoint(baseURL+'?sources=national-geographic&apiKey='+apiKey);
reqest.setMethod('GET');
reqest.setHeader('Accept','application/json');
Http h = new Http();
HTTPResponse response = h.send(reqest);
System.debug('result : + response.getBody());
@arun12209
arun12209 / NewsApp
Last active April 12, 2020 07:52
NewsApp
<apex:page showHeader="false" sidebar="false">
<apex:includeLightning />
<div id="LightningCompDisplayId"></div>
<script>
//please note that you need to create a lightning application and need to put the main component uder this app.
/* <aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess">
<aura:dependency resource="c:News"/>
<c:News />
@arun12209
arun12209 / COVID19_IND_LtngApp
Last active April 5, 2020 08:41
COVID19_IND_LtngApp
<aura:application access="GLOBAL" extends="ltng:outApp" implements="ltng:allowGuestAccess">
<aura:dependency resource="c:Covid19_IND_Tracker"/>
<c:Covid19_IND_Tracker />
</aura:application>
@arun12209
arun12209 / Covid19_Tracker_App
Created April 5, 2020 08:37
Covid19_Tracker_App
<apex:page showHeader="false" sidebar="false">
<apex:includeLightning />
<div id="LcDisplayId"></div>
<script>
$Lightning.use("c:Covid19_IND_TrackerApp", function() {
$Lightning.createComponent("c:Covid19_IND_Tracker",
@arun12209
arun12209 / Covid19_Tracking_ChartHelper
Created April 5, 2020 08:36
Covid19_Tracking_ChartHelper
({
CreateChart : function(component) {
var chartType= 'bar';
var action=component.get("c.fecthCovid19Data");
action.setCallback(this,function(response){
var state=response.getState();
if(state=='SUCCESS'){
var result = JSON.parse(JSON.stringify(response.getReturnValue()));
console.log('result : ' +JSON.stringify( result));
var data = [];
@arun12209
arun12209 / Covid19_Tracking_ChartController
Created April 5, 2020 08:35
Covid19_Tracking_ChartController
({
doInit : function(component, event, helper) {
helper.CreateChart(component);
}
})