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
@RestResource(urlMapping='/v.9/member/*/results/*') | |
global with sharing class MemberRestSvc { | |
@HttpGet | |
global static ReturnClass doGet() { | |
String[] uriKeys = RestContext.request.requestURI.split('/'); | |
// get the member name from the uri | |
String memberName = uriKeys.get(uriKeys.size()-3); |
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
@isTest | |
private class Test_MemberRestSvc { | |
static { | |
// setup test data | |
} | |
static testMethod void testDoGet() { | |
RestRequest req = new RestRequest(); |
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
@isTest | |
private class Test_MemberRestSvc { | |
static { | |
// setup test data | |
} | |
static testMethod void testDoGet() { | |
RestRequest req = new RestRequest(); |
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 AccountRegionTriggerHandler { | |
@future | |
public static void ProcessRegionsAsync(Set<ID> accountIds){ | |
// holds a map of the account id and comma separated regions to build | |
Map<Id, String> accountRegionMap = new Map<Id, String>(); | |
// get ALL of the regions for all affected accounts so we can build | |
List<Account_Region__c> accountRegions = [select id, Account__c, |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
, routes = require('./routes') | |
, rest = require('./rest.js') | |
, oauth = require('./oauth.js') | |
, url = require('url'); |
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
// only needed if calling the rest api from this file (accounts route) | |
var rest = rest = require('./../rest.js'); | |
/* | |
* GET home page. | |
*/ | |
exports.index = function(req, res){ | |
res.render('index', { title: 'Salesforce.com Node.js REST Demo' }) | |
}; |
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
require 'databasedotcom' | |
class Utils < Thor | |
desc "query SOQL", "runs a soql query and displays the value of each record's 'name' field" | |
method_option :config_file, :type => :string, :default => "databasedotcom.yml", | |
:aliases => "-c", :desc => "The name of the file containing the connection parameters." | |
def query(soql) | |
client = authenticate(options[:config_file]) | |
# execute the soql and iterate over the results to output the name |
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
client_id: YOUR-CLIENT-ID | |
client_secret: YOUR-CLIENT-SECRET | |
host: test.salesforce.com | |
debugging: false | |
username: YOUR-USERNAME | |
password: YOUR-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
var express = require('express') | |
, routes = require('./routes') | |
, util = require('util') | |
. async = require('async') | |
, nforce = require('nforce'); | |
var port = process.env.PORT || 3001; // use heroku's dynamic port or 3001 if localhost | |
var oauth; | |
// use the nforce package to create a connection to salesforce.com |
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
/** | |
* Module dependencies. | |
*/ | |
var config = require('./config.js'); | |
var express = require('express') | |
, faye = require('faye') | |
, nforce = require('nforce') | |
, util = require('util') | |
, routes = require('./routes'); |
OlderNewer