Need to report across combined Salesforce, ERP, and other data? We'll dig into a real-life example using Microsoft SQL Server and ForceAmp.com?s DBAmp to create a bi-directional Database Link to salesforce.com data. Join us and bring your questions and design concerns as we review the integration approaches and the expanded reporting capabilities of this solution.
Powerful Google developer tools for immediate impact! (2023-24 C)
Integrating Salesforce With Business Intelligence and Data Warehouses
1. Integrating Salesforce with Business
Intelligence & Data Warehouses
Tim Deagan, CORT Business Services
@TimDeagan
2. All about CORT Business Services. A Berkshire Hathaway Company
CORT, a Berkshire Hathaway Company, is the world’s largest provider of rental furniture and much,
much more. When life creates transition, CORT swings into action. Whether you are relocating
permanently or temporarily and in need of a place to live, furnishings and local knowledge, a business
needing swing space furnishings or a new identity, or just looking for total flexibility and lifestyle options,
CORT finds innovative solutions that make practical sense. When you have a special event, as a
company or individual, like a corporate gala, wedding, trade show, product launch or company meeting,
CORT is there to make your event special and memorable. .
▪ ~1000 Salesforce licenses
▪ Customer for 5 years
▪ Force.com active developers
▪ 59 Custom Objects, ~650,000 API requests/day
3. Salesforce data is great in the Cloud, until you need
it down to earth for…
▪ Enterprise Data Integration
• Cross System Reporting
• Moving Data within the Enterprise
▪ Reporting across more objects that Salesforce supports
• More than four object relationships (~= JOINS)
▪ Advanced Historical Data Queries
4. Bring your Salesforce data into an RDBMS
▪ Query and Report with your internal tools
• SQL, not SOQL
• ODBC to MS Excel, MS Access, etc.
▪ Populate your Data Warehouse with Salesforce fact data
• Objects become raw tables
• ETL into ROLAP, OLAP, HOLAP, MOLAP, DOLAP
6. DBAmp Functionality
▪ A SQL Server Linked Server to Salesforce production and sandbox
instances via HTTPS
▪ Real-time CRUD access
▪ Replication procedures to maintain local copies of Salesforce data
▪ Uses Salesforce API security
▪ Salesforce org based license (usable on unlimited servers)
▪ Great on-line support by the author
7. Two methods for real-time data access
SQL & SOQL
▪ SQL (technically Transact SQL or T-SQL)
• Uses ‘4-part’ naming convention
– ServerAlias.Catalog.Schema.LinkedTable
– Salesforce…Contact (Linked_Server_Name…Table)
• PRO
– Allows full range of SQL manipulation
• CON
– Pulls entire table into memory prior to executing WHERE clause or SQL
functions
8. Two methods for real-time data access
SQL & SOQL
▪ SOQL (technically SOQL via OPENQUERY)
• OpenQuery executes the passed query on the linked server
• PRO
– Higher performance
• CON
– To pass parameters, you must use a stored procedure that builds the query
string and executes it
9. CRUD access
CREATE & READ
▪ Create == Insert (Tables cannot be created)
• INSERT INTO Salesforce...Note (Body, IsPrivate, ParentId, Title) VALUES
('Body of Note 2','false', '00130000005ZsG8AAK','ToDelete')
• Stored procedure sf_bulkops provides batched bulk inserts
▪ Read == Select
• Select * from Salesforce...Contact
• Select * from openquery(Salesforce, ‘Select Id, CreatedDate, CreatedById
from Account’)
10. CRUD access
UPDATE & DELETE
▪ Update
• Update Salesforce…Account Set AnnualRevenue = 4000 Where
Id='00130000005ZsG8AAK'
• Update OPENQUERY(Salesforce, 'Select Id, AnnualRevenue from Account
where Id=''00130000005ZsG8AAK'' ') set AnnualRevenue = 4000
▪ Delete (Rows, not tables)
• Delete from Salesforce…Account Where Id='00130000005ZsG8AAK'
• Delete openquery(Salesforce,''Select Id from Account where
Id=''00130000005ZsG8AAK'' ‘)
11. Replicating Salesforce data locally
Incremental scheduled updates (hourly, daily, weekly, etc.)
▪ Stored Procedures for REFRESH and REPLICATE
• SF_Refresh brings over changes
• SF_Replicate brings over complete tables
▪ Schema changes are automatically detected and brought over
▪ Archived and deleted rows can be pulled over
▪ DRAMATICALLY faster queries than real time SQL or SOQL
▪ Local backup of Salesforce
14. CORT Architecture
▪ Tech Stack
• SQL Server 2008 R2, SQL Server 2012
• SQL Server Reporting Services (SSRS)
• SQL Server Integration Services (SSIS)
▪ ROLAP (Relational Online Analytical Processing) Environment
• No cubes
• Nightly jobs crunching data into user friendly tables and views (some denormalization)
• SSRS reports providing CSV for Excel usage as well as straight reporting
• Combines data from ERP, CRM, eCommerce, Call Center and Financials
15. Examples at CORT
Find and delete unnecessary custom fields
▪ Created “Field Usage” reports
▪ Developed a ‘hit list’ and eliminated hundreds of unnecessary fields,
merging the data into existing fields as appropriate
Emergency restores
▪ Over-eager Salesforce bulk loader user crufted 10,000+ records
▪ We restored the relevant data from a SQL Server backup
16. Examples at CORT
Upload data from other systems
▪ Revenue data from our National Accounts portal needed to be
linked to Salesforce accounts
• SQL was written to get the National Account data, cross link it to the
Salesforce Account ID and upload the revenue nightly to Salesforce so
salespeople can see it
▪ Data from our HR system is used to mod or delete User records in
Salesforce.
• Systems are kept in sync with nightly job
17. Examples at CORT
Salesforce as a CMS
▪ Our District Policies are maintained
by the Districts in Salesforce
• SSRS Report publishes the Policies to
Truck Drivers and Warehouse workers
without Salesforce licenses
18. Examples at CORT
Creation of complicated associations
▪ Our call center gets sales credit for the leases they ‘touch’
▪ This is determined by any one of a number of activities
▪ Requires determining if they were the Opp owner at any point in the
past
▪ We created a View in SQL Server that identifies all the Opportunties
that they get credit for touching…
19. Were they ever
the opp owner?
Were they the
initial opp owner?
Did they ever
own the lead that
became the opp?
Did they create
the lead that
became the opp?
20. Examples at CORT
We wanted to segregate a line of business into a new Salesforce
instance/org.
▪ Extract all relevant Salesforce data (opps, leads, contacts, accounts,
attachments, etc.) for the LOB into SQL Server
▪ Create tables of all ID based relationships
• 415 fields containing keys
▪ Upload records to the new org
▪ Find new object IDs
▪ Change all references to the old IDs to the new IDs in SQL Server
▪ Update records with correct relationship IDs