Salesforce Integration Patterns & Best Practices – with Video

When to use which integration patterns in Salesforce along with best practices. Video to show how to use Outbound message to integrate Salesforce without writing code

Recently I gave talk in one of most active webinar of Salesforce ecosystem today – Apex hours on topic Integration Patterns and Best Practices in Salesforce.

Response was more than expected and questions were high quality. Therefore, I thought to quickly write high level summary of presentation in this blog post along with Youtube video that you can find towards the end of this post.

Firewall, Proxy and Reverse Proxy

Before integrating anything with Salesforce, as per Architect, it is necessary which system components are important for security and may impact with integration pattern to be used.

Firewalls : It controls and protects Malicious Traffics. Firewall can be hardware or software based.

Proxy aka Forward Proxy : Proxy normally configured in your browser or systems like VsCode, data loader, eclipse to hide your actual identity. Every outgoing request transmits through proxy server to make sure external systems unaware about your true origin and identity

Reverse Proxy : Its used by Web Servers and sits before it. It can server any purpose like authentication or perform security related stuff. Best example is Mulesoft where we can configure API proxy which is used to apply throttling, avoiding DoS attacks or applying SLA as per licenses provided to customer

Continue reading “Salesforce Integration Patterns & Best Practices – with Video”

Federated Search in Salesforce

Search content of Jitendra Zaa’s blog using federated search in Salesforce

Using Federated Search, we can search for content outside Salesforce. Federated Search utilizes Open Search Document behind the scene. Open Search was coined by Jeff Bezos (CEO – Amazon) in March 2005. Open Search is a collection of technologies & standards that allows publishing of results to be utilized by Search Engines.

For Demo purpose, I have enabled my website compatible with Open Search at below URL

https://www.jitendrazaa.com/blog/wp-json/opensearch/1.1/document

Step 1 :

Add External Data Source by clicking New External Data Source.

Provide any suitable name – in this case Jitendra’s Blog.

Select Federated Search : OpenSearch as Type.

Provide this path for OSD (Open Search Document) file format – https://www.jitendrazaa.com/blog/wp-json/opensearch/1.1/document

Click on Validate and Sync.

Step 2 :

Create permission set giving permission to view this External Object and all fields. Assign this permission set to anyone who needs to use search for content outside Salesforce.

We can also enable this federated search in Communities by updating global Search Component and giving community members access to this newly created permission set.

Once above setup is completed – you can search for any term on global search and select External Results as shown in below image :

Defining pipe delimited separator in Mulesoft 3 & 4

How to use Pipe delimiter as separator in Mulesoft 3 and 4

Mulesoft 3

As discussed in previous post, to use pipe operator as separator. Navigate to Reader Configuration of Transformation message component

Reader Configuration in Transform Message - Mulesoft 3
Reader Configuration in Transform Message – Mulesoft 3
Continue reading “Defining pipe delimited separator in Mulesoft 3 & 4”

Use pipe delimited file to upsert record in Mulesoft 3

Use Mulesoft to upsert record in Salesforce using Pipe delimited file

Processing Comma Separated file is out of box but what if text file is delimited using comma.

In this post, we will read Pipe delimited file and upsert record in Salesforce. Instead of upserting record in Salesforce, you can do anything else you want to.

This is how final job will look like :

Continue reading “Use pipe delimited file to upsert record in Mulesoft 3”

Salesforce Integration with SQL Server Integration Services

Video – Connecting SQL Server Integration Services (SSIS) with Salesforce using COZYROC Connector

On April-14, 2018,  I had a chance to conduct online session on demonstrating integration between SQL Server Integration Services (SSIS) and Salesforce with the help of COZYROC connector.

This session covered below topics

  • Introduction to ETL
  • What is SQL Server Integration Services (SSIS)
  • COZYROC connector
  • Demo of extracting and updating records in Salesforce
  • Demo of downloading attachments from Salesforce
  • Demo of uploading attachments in Salesforce
  • Best Practices – How to configure SSIS package to avoid hardcoding
  • Best Practices – enabling logging

Continue reading “Salesforce Integration with SQL Server Integration Services”

10 Salesforce Integration design considerations from Architect point of view – Mind Mapping included

After working on multiple Salesforce implementation project as an Architect, its time to share what I learned from those implementations and would strongly suggest to be considered before designing any “Salesforce Integration”.

Below image shows “integration mind mapping” used by me. I use it to consider some major aspects while discussing integration approaches with enterprise architects in various meetings. This image is very high level however if you think some more points to be considered or have some other thoughts on same, please share.

Salesforce Integration Mind mapping diagram
Salesforce Integration Mind mapping diagram

1. Data Compliance

Lets start with Compliance part first. It is possible that client has confidential data and doesn’t want to move it to Cloud. In that case, we can expose existing web application of Client using some Salesforce products like “Canvas” or “Lightning Connect”.  For Lightning Connect, data needs to be available on DMZ layer however for Canvas it can exist on Intranet and therefore end users can access data only within office, providing flexibility of cloud and security of intranet. Continue reading “10 Salesforce Integration design considerations from Architect point of view – Mind Mapping included”

Salesforce to Salesforce integration using Canvas

After writing this article Salesforce has enabled CSP (Content Security Policy) which restricts adding Salesforce in iFrame. We can add MyDomain URL as CSP whitelisting and it works only if user already logged into other Salesforce instance. However, if user is not logged into other instance , internally OAuth navigates through login.salesforce.com which is too restrictive and canvas application fails to load.

In this post we will discuss how Canvas can be used to integrate Salesforce with Salesforce. On my blog we have seen many articles and possibilities to integrate Salesforce with another Salesforce instance like this and this post.

Whats is force.com Canvas

Force.com Canvas SDK from Salesforce allows developers to connect existing legacy system or any web based application with Salesforce using JavaScript and REST API. Canvas applications can be displayed in Chatter, Salesforce Mobile Cards or Visualforce page.

Why we are accessing another Salesforce instance as Canvas app

To get hands on with Canvas, most of article are around creating Heroku applications. I understand there are few developers who are not comfortable with Heroku. So to keep learning curve less, lets use Visualforce page to be exposed as Canvas application after all Visualforce is very advance MVC framework in itself. Continue reading “Salesforce to Salesforce integration using Canvas”

Salesforce to Salesforce integration using Named Credentials in 5 lines

I have already written article to integrate Salesforce with other Salesforce instance around 3 years back. In last 3 years, Salesforce has changed a lot. This time I will integrate Salesforce with other Salesforce only only in 5 lines of code, can you believe it  🙂 ? Check my old article, and its around 50+ lines of code with security control.

What is Named Credential ?

A named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. You can simplify the setup of authenticated Apex callouts by specifying a named credential as the callout endpoint. You can instead specify a URL as the callout endpoint and register that URL in your organization’s remote site settings. In that case, however, you handle the authentication in your code. Doing so can be less secure and especially complicated for OAuth authentication.

Long description short , “using Named Credential, we can make call out to external system without supplying username or Password”.

Continue reading “Salesforce to Salesforce integration using Named Credentials in 5 lines”

Call Salesforce REST API from Apex

Author posted by Jitendra on Posted on under category Categories Salesforce and tagged as Tags , with 5 Comments on Call Salesforce REST API from Apex

Use Apex to call Salesforce REST API with sample source code

In previous post, we saw that how Visualforce can be used to call Salesforce Rest API. In this short post, I would share a small piece of code to demonstrate how to use Apex to call Salesforce REST API.

First and foremost step is to add your Salesforce instance URL in Remote site settings. Once that is done, use below sample Apex code to call Salesforce REST API.

I am using API to get metadata information about Salesforce object however that can be replaced by any supported REST API of Salesforce. Continue reading “Call Salesforce REST API from Apex”

Salesforce REST API Playground

What is REST API ?

In my words, Getting data from Other System or Same System using HTTP request is known as REST API.

If you know, how website works, you know REST API. Before REST API, there was SOAP request which needed lots of configuration and very tightly coupled. If you make any modification , you had to modify client side also by generating stubs / proxy classes again. There were many more disadvantages which got address by REST API. However, it doesn’t mean we don’t need SOAP.

Back to REST API, It is very simple to setup and almost any programming language can make HTTP request so very easy to get data from other source. Return type of REST API can be XML, Simple HTTP, JSON or any media like image. However, JSON is very popular response type amongst all.

In Past, I have already written one article demonstrating REST API usage.

How to use Salesforce REST API using JQuery in Visualforce ?

REST API Playground : I have created Simple Visualforce page, which demonstrates how to use REST API of Salesforce. It is written in Visualforce with the help of JQuery. You can study this code and play with it in your organization, you just need to copy and paste it.

You also need to add URL “http://cdnjs.cloudflare.com” in Remote Site Settings, so that salesforce will allow Visualforce page to get JQuery library from CDN.

Continue reading “Salesforce REST API Playground”