This file contains 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
const jsforce = require("jsforce"); | |
const axios = require("axios"); | |
var FormData = require("form-data"); | |
const getStream = require("get-stream"); | |
const mime = require("mime-types"); | |
const conn = new jsforce.Connection({ | |
loginUrl: "https://login.salesforce.com", | |
}); | |
const username = ""; | |
const password = ""; |
This file contains 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 OpportunityDataService { | |
@AuraEnabled(cacheable=true) | |
public static Map<String, Integer> aggregateOpportunities(String accountId){ | |
Map<String, Integer> opportunityStatusMap = new Map<String, Integer>(); | |
//Aggregate the opportunities. | |
for(AggregateResult aggr : [SELECT Count(Id), StageName | |
FROM Opportunity | |
WHERE AccountId=:accountId | |
GROUP BY StageName]) { |
This file contains 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 ContactList { | |
@AuraEnabled (Cacheable=true) | |
public static List<Contact> fetchContactLocal(){ | |
return [SELECT Id, FirstName, LastName | |
FROM CONTACT Order By FirstName ASC]; | |
} | |
@AuraEnabled (Cacheable=true) | |
public static List<Contact> fetchContact(String field, String sortOrder){ | |
return Database.query('SELECT Id, FirstName, LastName FROM Contact ORDER BY '+field+' '+sortOrder); |
This file contains 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
<template> | |
<lightning-datatable | |
key-field="Id" | |
data={results} | |
columns={columns} | |
hide-checkbox-column ="false" | |
show-row-number-column="true" | |
onsort={updateColumnSorting} | |
sorted-by={sortBy} | |
sorted-direction={sortDirection} |
This file contains 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
<template> | |
<lightning-datatable | |
key-field="Id" | |
data={results} | |
columns={columns} | |
hide-checkbox-column ="false" | |
show-row-number-column="true" | |
onsort={updateColumnSorting} | |
sorted-by={sortBy} | |
sorted-direction={sortDirection} |
This file contains 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
/******** | |
Copyright (c) <2015> <junglee Force([email protected])> | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: | |