Needless to say, every software vendor wants to create and launch a successful application – not the one to be lost in a sea of competition where everyone struggles to be the best.Salesforce is a big name in the industry because of its products. Salesforce designs its products in such a way that it is easy to configure and use. When I started my career, Salesforce user interface (legacy) looked like the following screenshot:
Later, Salesforce came up with the Classic user interface that many of us are currently using. The classic user interface looked like the following screenshot:
In 2015, Salesforce released a new user interface known as Lightning Experience. Lightning Experience is a new generation productive user interface designed to help Read the rest of this entry!
Salesforce-to-Salesforce can be used to share the data both within and across Salesforce organizations.Salesforce-to-Salesforceis a natively supported feature of theSalesforcePlatformand easily enables two dealing partners to share relevant data records in real time. It allows you to share records with your business partners that use Salesforce and get real-time updates on the shared data. For example, you can share Opportunity and Lead data with business partners. Key Pain Points in Salesforce-to-Salesforce connection is to share the data manually. If you want to automate the data sharing process, then you have to use the Apexcode. Let’s start with a business use case
Business Use case
Martin Jones is working as a System administrator at Universal Containers (UC). His company as well as another company (Acme Corp), has established Salesforce-to-Salesforce. He has received a requirement from higher management to auto-share the new opportunities with Acme Corp if opportunity Lead Source doesn’t equal to Web.
Solution for the above business requirement
There are multiple solutions possible for the above business scenario. We will use Flow and Process Builder to solve the above business requirement. Before proceeding you have to understand below-mentioned objects in Salesforce
This article will help you to understand how to auto-forward records to a Connection and way to Launch a Flow from Process Builder. Follow the below instructions to create a Flow and Process for the above business requirement
1. To create a Flow, navigate to Setup (Gear Icon) | Setup | PLATFORM TOOLS | Process Automation | Flow. 2. Now click on the New Flow button; it will open the Lightning Flow Designer for you. Now create oneTextvariableVarT_OpportunityId to store the Opportunity Id. We will use this variable in the flow, as shown in the following screenshot:
Likewise, create one moreTextvariable VarT_ConnectionId to store the ID of the connection a record is shared with. To get the Partner Network Connection Id one possible workaround is to use the Developer Console. Click onSetup (Gear icon) | Developer Console and run the below SOQL query
select ConnectionName,id from PartnerNetworkConnection where ConnectionStatus=’Accepted’
It will look like the following screenshot
SOQL Query – To get Partner Network Connection Id
You can also find this information from Connection Tab.VarT_ConnectionIdwill look like the following screenshot:
3. The next step is to auto-share the Opportunity records with Partner connection. For this, we will use the Create Records element. Drag-and-dropCreate RecordsElement on the Lightning Flow Designer and fill the details as shown in the following screenshot:
4. Finally, yourFlow will look like the following screenshot
5. Click on the Savebutton and save the Flow with the nameAuto Share Opportunity with Connectionas shown in the following screenshot
6. Don’t forget toActivatethe Flow.
Launch a Flow from the Process Builder
Our next task is to create a Process onOpportunity object to Launch a Flow, only when an Opportunity Lead Source doesn’t equal to Web. To create a Process on theOpportunity object follow the below instructions
1. The next step is to create a process, that will fire when a new user gets created. To do this, Navigate to Setup (Gear Icon) | Setup | Process Automation | Process Builder
2. To create a new process from scratch, click on the NewButton available on Process Management page. A popup will appear where you have to enter the Name, API Name and Description as shown in the screenshot below:
Define Process Properties
3. Once you are done click on theSave button, it will redirect you to Process canvas. Click on Objectnode to add object, SelectOpportunity object, in this case, and set the evaluation criteria, Please refer to the following screenshot for more details
3. Once you are done click on theSave button, it will redirect you to Process canvas. The next step is to define the Process criteria. For this click onAdd Criterianode, enter Criteria Name, Set filter conditions (Similar to Rule Criteria in WFR), as shown in the following screenshot
4. Once you are done click on theSavebutton, it will redirect you to Process canvas. Now we have to add an Immediate action into the Process to Launch a Flow. For this useFlowsaction. UseField Pickerto select the field Description andText Entry field to enter a comment or sentence. Please refer the following screenshot for more information
Add action – Flows
5. Once you are done click on the Savebutton, it will redirect you to Process canvas. Finally, the Processwill look like the following screenshot
Don’t forget to active the Process by clicking on the Activatebutton
It’s time to test this Process
Now onwards if a business user creates a new Opportunity record with Lead Source other than the Web, then Process Builder will automatically share it with Partner Network Connection Acme Corp
1. Now create a new Opportunity with Name “Burlington Textiles Weaving Plant Generator – Second Phase” and Lead Source blank. Then check the External Sharing related list available on the Opportunity Detail page, as shown in the following screenshot
Auto Share Opportunity with Connection
Process Builder automatically shared the new Opportunity with partner network connection Acme Corp.
Note: – I will suggest you implement this first on your developer org test it and then move it to Production.