Archives

Force.com OAuth 2.0 Scribe Java Example

OAuthServiceConfig and OAuthServiceProvider Bean in ApplicationContext SalesforceOauthApi extends DefaultApi20 Spring MVC SalesforceController for requesting access token

Rate this:

Read More

Force.com Tooling API IDE

Cloudsole Developer is an easy way to develop Salesforce apex classes, triggers, components and visualforce pages. It uses the salesforce API to access your code in a safe and secure way. Some of the functionality of the IDE: Create new Apex Triggers Classes, Visualforce Pages & Components Select from a list of predefined templates to create class stubs Code […]

Rate this:

Read More

Force.com HTTPCallout Test Class

Below is the test class to test an HTTP Callout from apex: Main Test Class HTTP Callout Mock As this is a POST there is no allot of response but the statusCode. 201 means created so the feed was successfully created.

Rate this:

Read More

Apigee as Force.com REST provider

Apigee has an extensive Force.com REST interface to interact with Salesforce. Follow this tutorial to create an app in apigee, create a remote connection in Salesforce, add a user to the app to get your smart-key. Complete the tutorial below to get the information needed to run this class: http://developer.apigee.com/salesforce_tutorial.html You will need the following […]

Rate this:

Read More

Force.com FourSquare Visualforce Page

Set in visualforce page: var client_id = ‘YOURCLIENTAPPID’; var callback_url = https://.salesforce.com/apex/FourSquarePage Set in FourSquare App Setup Page: Redirect URL https://.salesforce.com/apex/FourSquarePage

Rate this:

Read More

Force.com REST Swagger Spring MVC

Swagger is a specification and complete framework implementation for describing, producing, consuming, and visualizing RESTful web services. The overarching goal of Swagger is to enable client and documentation systems to update at the same pace as the server. The documentation of methods, parameters, and models are tightly integrated into the server code, allowing APIs to […]

Rate this:

Read More

Force.com Unit Testing Best Practice

Test classes should use the @isTest annotation Test methods setup() creates all data needed for a method and does not rely on current data in Org public static List<Asset> setup(Decimal assetAssetInstanceNumber, String productName)     { Product2 productId = new Product2(Name=productName); insert productId;         Account account = new Account(Name = ‘[TEST] Account […]

Rate this:

Read More

Java Code: Export Salesforce Attachements to Dropbox

I wrote a class the exports Salesforce Attachements to be exported to your local Machine. I put the exported attachement files in a dropbox folder which is automatically the shared with others in the organization. Note: make sure the export directory is shared on Dropbox. package com.thys.michels.sfdc.doc; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.net.URISyntaxException; […]

Rate this:

Read More