Skip to content

Instantly share code, notes, and snippets.

@jungleeforce
jungleeforce / main.js
Created November 2, 2021 23:32
File migration between Salesforce Orgs using Node.js
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 = "";
@jungleeforce
jungleeforce / OpportunityDataService.cls
Last active August 18, 2019 07:22
Opportunity Chart container.
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]) {
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);
<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}
<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}
@jungleeforce
jungleeforce / almNodeAuthentication.js
Last active January 19, 2021 06:00
Node.js + ALM + REST API = Awesome
/********
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: