Tag Archives: Salesforce

Azure Active Directory integration with Salesforce Sandbox


The main goal of this blog is to show how to integrate Salesforce Sandbox environment with Azure Active Directory, using the Windows Azure AD single Sign-On configuration option. Before continuing, you should meet the following requirements: A valid Azure Active Directory Subscription A Sandbox environment on Salesforce .com with a System Admin user on this […]

https://buildwindows.wordpress.com/2015/09/08/azure-active-directory-integration-with-salesforce-sandbox/

Catching Salesforce Outbound Messages with NodeJS


via Catching Salesforce Outbound Messages with NodeJS – topcoder.

When building applications that are integrated with Salesforce, one of the choices you have to make is howyou get data out of Salesforce and into your app. You can use one of the many ETL tools on the market, you can poll for changed records, use the Force.com Streaming API, use Apex HTTP Callouts from Salesforce or Outbound Messages.

I’ve covered most of these approaches in the past but have purposefully overlooked Outbound Messages. Why? Because, in general, I hate working with XML. Perhaps it harkens back to my SAP days but every time I have to traverse an XML structure, I think a kitten dies somewhere.

However, with that said, Outbound Messages are quite magical. You hook them up as an action to yourWorkflow Rule, so that whenever a record is, for example, created or updated in some manner, the platform will fire off some record data to the endpoint specified in the Outbound Message. My only issue with them is that they only support XML and most web languages like Ruby, JavaScript, Go, etc. prefer JSON (and so do I). So here’s a simple NodeJS app that will receive the XML from your Outbound Message and convert it into a JavaScript object that you can then use to do all sorts of awesome stuff!

*You can find all of the code for this application at my github repo. What follows is the interesting part that catches the XML and parses it in routes/obm.js.

Salesforce: Displaying DateTime Field in Visualforce in User’s TimeZone


I just ran into a quirk with displaying DateTime fields in visualforce. Apparently, the  tag does not convert the date into the current user’s timezone but rather renders it in GMT (the value as salesforce stores it internally). Problem: Renders: Tue May 27 02:50:00 GMT 2014 I did some googling and came across this […]

Salesforce: How to Export Queue Members to Excel


As of this writing, Salesforce provides no way of reporting on who belongs to which queues. To know who is a queue member, you must either (a) go to the Salesforce Setup page to manage the queue or (b) run a SOQL query and join on groupmember object then export the data using Data Loader […]

Simple Python-based OAuth2 web client with connectors for Salesforce and GitHub


Click to Read

A simple web server that initiates an OAuth2 request and saves the access token.

A starter project for Ionic and Salesforce


README.md

Starter pack for building Ionic apps on top of the Salesforce platform created as a partnership between Ionic and Salesforce.

This is an addon starter template for the Ionic Framework. The template installs a starter application that uses Salesforce OAuth to authenticate, and the Salesforce REST APIs to access and manipulate Salesforce data.

How to use this template

To use this starter pack, you’ll need to have installed Ionic and Cordova:

$ sudo npm install -g ionic cordova

Then, all you need to do is run:

$ ionic start myApp salesforce

Running on device

Navigate (cd) to myApp and run:

$ ionic platform add ios
$ ionic build ios
$ ionic emulate ios

Substitute ios for android, but if you can, the ios development toolchain is a lot easier to work with until you need to do anything custom to Android.

Running in the browser

Because of the browser’s cross-origin restrictions, your Ionic application hosted on your own server (or localhost) will not be able to make API calls directly to the *.salesforce.com domain. The solution is to proxy your API calls through your own server. You can use your own proxy server or use ForceServer, a simple development server for Force.com. It provides two main features:

  • A Proxy Server to avoid cross-domain policy issues when invoking Salesforce REST services. (The Chatter API supports CORS, but other APIs don’t yet)
  • A Local Web Server to (1) serve the OAuth callback URL defined in your Connected App, and (2) serve the whole app during development and avoid cross-domain policy issues when loading files (for example, templates) from the local file system.

To run the application in the browser using ForceServer:

  1. Install ForceServer
    $ sudo npm install -g force-server
  2. Navigate (cd) to your Ionic app’s www directory
  3. Start the server
    force-server
    

    This command will start the server on port 8200, and automatically load your app (http://localhost:8200) in a browser window. You’ll see the Salesforce login window (make sure you enable the popup), and the list of contacts will appear after you log in. If you don’t have a free Salesforce Developer Edition to log in to, you can create one here.

    You can change the port number and the web root. Type the following command for more info:

    force-server --help
    

OAuth and REST

This template uses forceng, a micro-library that makes it easy to use the Salesforce REST APIs in AngularJS applications. forceng allows you to easily login into Salesforce using OAuth, and to access your Salesforce data using a simple API.

A starter project for Ionic and Salesforce


README.md

Starter pack for building Ionic apps on top of the Salesforce platform created as a partnership between Ionic and Salesforce.

This is an addon starter template for the Ionic Framework. The template installs a starter application that uses Salesforce OAuth to authenticate, and the Salesforce REST APIs to access and manipulate Salesforce data.

How to use this template

To use this starter pack, you’ll need to have installed Ionic and Cordova:

$ sudo npm install -g ionic cordova

Then, all you need to do is run:

$ ionic start myApp salesforce

Running on device

Navigate (cd) to myApp and run:

$ ionic platform add ios
$ ionic build ios
$ ionic emulate ios

Substitute ios for android, but if you can, the ios development toolchain is a lot easier to work with until you need to do anything custom to Android.

Running in the browser

Because of the browser’s cross-origin restrictions, your Ionic application hosted on your own server (or localhost) will not be able to make API calls directly to the *.salesforce.com domain. The solution is to proxy your API calls through your own server. You can use your own proxy server or use ForceServer, a simple development server for Force.com. It provides two main features:

  • A Proxy Server to avoid cross-domain policy issues when invoking Salesforce REST services. (The Chatter API supports CORS, but other APIs don’t yet)
  • A Local Web Server to (1) serve the OAuth callback URL defined in your Connected App, and (2) serve the whole app during development and avoid cross-domain policy issues when loading files (for example, templates) from the local file system.

To run the application in the browser using ForceServer:

  1. Install ForceServer
    $ sudo npm install -g force-server
  2. Navigate (cd) to your Ionic app’s www directory
  3. Start the server
    force-server
    

    This command will start the server on port 8200, and automatically load your app (http://localhost:8200) in a browser window. You’ll see the Salesforce login window (make sure you enable the popup), and the list of contacts will appear after you log in. If you don’t have a free Salesforce Developer Edition to log in to, you can create one here.

    You can change the port number and the web root. Type the following command for more info:

    force-server --help
    

OAuth and REST

This template uses forceng, a micro-library that makes it easy to use the Salesforce REST APIs in AngularJS applications. forceng allows you to easily login into Salesforce using OAuth, and to access your Salesforce data using a simple API.