This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class DataWrapper { | |
public integer zoomLevel {get;set;} | |
public decimal scale {get;set;} | |
public string title {get;set;} | |
public decimal latitude {get;set;} | |
public decimal longitude {get;set;} | |
public string url {get;set;} | |
public DataWrapper (integer zoomLevel,decimal scale, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class AccountTest{ | |
@AuraEnabled | |
public static list<Account> getlstacc(){ | |
return [Select Id , Name , NumberofLocations__c from Account order by NumberofLocations__c limit 10]; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class AccountTest{ | |
@AuraEnabled | |
public static list<AccountWrapper> getlstacc(){ | |
list<AccountWrapper> lstWrapper = new list<AccountWrapper>(); | |
for(Account acc :[Select Id , Name , NumberofLocations__c from Account order by NumberofLocations__c limit 10]){ | |
AccountWrapper accWrap = new AccountWrapper(); | |
accWrap.Name = acc.Name; | |
accWrap.noOfLocations = integer.valueof(acc.NumberofLocations__c); | |
lstWrapper.add(accWrap); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
({ | |
fetchContactList : function(component, event, helper) { | |
var action = component.get("c.getContacts"); | |
action.setCallback(this, function(response) { | |
var state = response.getState(); | |
if (component.isValid() && state === "SUCCESS") { | |
component.set("v.contacts", response.getReturnValue()); | |
} | |
}); | |
$A.enqueueAction(action); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class StandardDeviationComputation { | |
public static decimal getStandardDeviation(Integer precision){ | |
AggregateResult[] groupedResults = [SELECT COUNT(Id),SUM(DistanceSquare__c) FROM Survey__c GROUP BY Standard_Deviation__c ]; | |
decimal sumOfDistanceSquare = (decimal)groupedResults[0].get('expr1'); | |
integer count = (integer)groupedResults[0].get('expr0'); | |
if(count > 0){ | |
return system.Math.sqrt(sumOfDistanceSquare/count).setScale(precision);//Scale is kept at 3 currently | |
}else{ | |
return 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public with sharing class ApexMetadataUtility { | |
/** | |
* Call apex controller method fetch metadata | |
* @param | |
* @return void | |
*/ | |
@AuraEnabled | |
public static list<SobjectMetadataWrapper> getSobjectMetadata(String[] sobjectarray){ | |
list<SobjectMetadataWrapper> lstsobjectMetadata = new list<SobjectMetadataWrapper>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes" access="global" controller="ApexMetadataUtility"> | |
<aura:attribute name="metadata" type="SobjectMetadataWrapper[]"/> | |
<aura:handler name="init" value="{!this}" action="{!c.getresults}" /> | |
<div class="slds-tree_container" role="application"> | |
<h4 class="slds-text-title--caps" id="treeheading">Objects</h4> | |
<aura:iteration items="{!v.metadata}" var="cardItem"> | |
<ul class="slds-tree" role="tree" aria-labelledby="treeheading"> | |
<li id="tree0-node0" role="treeitem" aria-level="1"> | |
<div class="slds-tree__item"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component | |
implements="lightning:actionOverride,force:hasRecordId,force:hasSObjectName"> | |
<article class="slds-card"> | |
<div class="slds-card__header slds-grid"> | |
<header class="slds-media slds-media--center slds-has-flexi-truncate"> | |
<div class="slds-media__body"> | |
<h2><span class="slds-text-heading--small">Answer Below Questions to Proceed to Account Creation?</span></h2> | |
</div> | |
</header> | |
<div class="slds-no-flex"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<aura:component > | |
implements="lightning:actionOverride,force:hasRecordId,force:hasSObjectName"> | |
<aura:handler name="render" value="{!this}" action="{!c.onRender}"/> | |
<aura:attribute name="test" type="String"/> | |
{!v.test} | |
<lightning:button label="Edit" onclick="{!c.handleEdit}"/> | |
</aura:component> |