Integration of 3Rd Party Applications Into Salesforce CRM
Total Page:16
File Type:pdf, Size:1020Kb
Masaryk University Faculty of Informatics Integration of 3rd party applications into Salesforce CRM Master’s Thesis Jakub Hančin Brno, Spring 2020 Masaryk University Faculty of Informatics Integration of 3rd party applications into Salesforce CRM Master’s Thesis Jakub Hančin Brno, Spring 2020 This is where a copy of the official signed thesis assignment and a copy ofthe Statement of an Author is located in the printed version of the document. Declaration Hereby I declare that this paper is my original authorial work, which I have worked out on my own. All sources, references, and literature used or excerpted during elaboration of this work are properly cited and listed in complete reference to the due source. Jakub Hančin Advisor: RNDr. Josef Spurný i Acknowledgements My first great thanks goes to my soon-to-be wife Miriam Kanovská who was extremely supportive during the creation of this thesis and who will hopefully not change her mind about marrying me once the defence of this thesis is over. A large thanks go to my supervisor Josef Spurný, who was a great lecturer of mine and who was seemingly the only person in the entire Faculty of Informatics willing to supervise such a specific thesis as mine was. Big thanks goes to my former colleagues at the Enehano company in Prague who taught me nearly everything you can find in the practi- cal as well as theoretical part of this thesis. Great thanks goes to Jiří Mach and Michal Peška, who founded an extraordinary company and turned out to be the most pleasurable bosses I have ever had. Another huge thank you goes to Michal Mach and Milan Bodlák, my fellow developer colleagues at Enehano who were willing to give me advice whenever I needed it. And big thank you goes to Craig Jordan and the LeanTaaS company who allowed me to use an example fitting a master’s thesis on such a topic perfectly. And the one person I cannot forgot is my uncle Miroslav Barus who had the patience to lecture me during weekends during my first year at FI and without whom I would probably never become an IT graduate. ii Abstract CRM platform development as a market is rapidly growing the already rapidly growing IT industry. This thesis focuses on the current CRM market leader Salesforce and with the help of a practical example which demonstrates the possibilities of this platform. The practical example is a functional 3rd party integration applica- tion developed under the wings of the SaaScend company for a client called LeanTaaS. This example shows how to integrate a JSON data source into Salesforce on an automatic and periodical basis. Not only does this thesis summarize the technical difficulties of performing such a task but it also provides a detailed walkthrough on the development steps required to take prior to deploying the developed code to production. The purpose of this thesis is to help any beginner Salesforce or Java developers who were given the task to integrate two or multiple different systems together to get a better grasp of the problem, propose possible solutions and potentially provide a good starting point on the analysis front as the principles of building such an integration remain nearly always the same. iii Keywords Salesforce, CRM, Apex, REST, API, Integration, Org, Schedulable, Change Set, Production, Sandbox, Multitenancy, SOQL, SOSL, Trail- head, Dreamforce, Pulling, Pushing, The Welkin Suite, Visual Studio, Access token, Bearer Token, Http, CRON, Script, Salesforce Developer console iv Contents Introduction 1 1 CRM platforms introduction 2 1.1 What is a CRM ........................2 1.2 CRM adoption ........................2 1.3 CRM platform market ....................3 1.4 Economic relevance of the CRM market ...........4 1.5 Subscription-based CRM platforms .............5 1.5.1 Salesforce CRM . .5 1.5.2 SAP CRM . .6 1.5.3 Oracle CRM . .7 1.5.4 Microsoft Dynamics CRM . .8 1.6 CRM platforms with a free plan ...............9 1.6.1 HubSpot CRM . .9 1.6.2 Zoho CRM . 10 1.7 CRM platforms comparison ................. 11 2 Salesforce CRM 13 2.1 History ............................ 13 2.2 Salesforce - community specifics ............... 14 2.2.1 Trailhead - the Salesforce learning platform . 14 2.2.2 Dreamforce - the Salesforce yearly conference . 15 2.3 Salesforce - technological specifics .............. 16 2.3.1 Multitenancy . 16 2.3.2 Limits . 16 2.3.3 Apex - Salesforce programming language . 17 2.3.4 SOQL - Salesforce Object Query Language . 18 2.3.5 SOSL - Salesforce Object Search Lanuage . 19 3 Integrations - implementation approaches 20 3.1 Introduction .......................... 20 3.2 Pulling ............................ 20 3.2.1 Requirements . 21 3.2.2 Advantages . 21 3.2.3 Disadvantages . 21 3.3 Pushing ............................ 22 v 3.3.1 Requirements . 22 3.3.2 Advantages . 23 3.3.3 Disadvantages . 23 3.4 Conclusion .......................... 24 4 Author REST application - case study 25 4.1 Introduction .......................... 25 4.1.1 Context . 25 4.1.2 Project context . 25 4.1.3 Description of the objective . 26 4.1.4 Project - team & pre-project analysis . 26 4.2 Obstacles to overcome ..................... 27 4.2.1 Data heterogeneity . 27 4.2.1.1 Solution . 27 4.2.2 URL encoding query requirement . 28 4.2.2.1 Solution . 28 4.2.3 Periodicity . 28 4.2.3.1 Solution . 28 4.2.4 Authorization . 29 4.2.4.1 Solution . 29 5 Author REST application - pre-development setup 32 5.1 Sandbox - testing environment ................ 32 5.1.1 Configuration . 32 5.1.2 Change set - uploading changes from a sandbox to production . 33 5.2 Org preparation ........................ 34 5.2.1 Custom object creation . 34 5.2.2 Custom field creation . 35 5.3 Suitable IDE ......................... 37 5.3.1 Developer console - native Salesforce tool . 37 5.3.2 The Welkin Suite - external IDE based on Visu- alStudio . 37 6 Author REST application - implementation 39 6.1 Introduction .......................... 39 6.1.1 Overview of the functionality . 39 6.1.2 Restrictions in possible recreation . 39 vi 6.1.3 Structure of code analysis . 39 6.2 Project structure ....................... 40 6.2.1 Integration functionality - code hierarchy . 40 6.2.2 Test class - mandatory unit tests . 42 6.3 Code Analysis ......................... 44 6.3.1 Data Retrieval . 45 6.3.2 Token Retrieval . 46 6.3.3 Http Module . 47 6.3.4 SObjects Module . 48 7 Author REST application - conclusion 50 7.1 Introduction .......................... 50 7.2 Scheduling the Schedulable classes .............. 50 7.2.1 Requirements . 50 7.2.2 CRON expression . 50 7.3 Running the job creation script ................ 51 7.4 Scheduled job maintenance .................. 52 7.5 Implementation conclusion .................. 53 7.6 Project conclusion ....................... 53 8 Conclusion 54 Bibliography 55 vii List of Tables viii List of Figures 2.1 Apex code example - example taken from wisdomjobs.com 18 4.1 Authorization process modeled by Jakub Hančin in Signavio modelling software 30 5.1 A screenshot of Deployment settings - sandbox allowance 33 5.2 A screenshot of Object Manager - creation of Custom Objects 35 5.3 A screenshot of the Object Manager - custom field creation 36 5.4 A screenshot of the Developer Console - native development tool of Salesforce opened in Mozilla Firefox browser 38 5.5 A screenshot of The Welkin Suite - 3rd party IDE 38 6.1 SaaScend - LeanTaaS DefHC project structure 41 6.2 An example of a mock String constant and the overriding of a respond() method in a test context. If the respond() method is called with a specific endpoint with specific values in the test context, the body of the response is overwritten with the mockup String contant. 43 6.3 Class interaction diagram created in Lucidchart by Jakub Hančin 44 6.4 Data retrieval main method - performDefinitiveDataPull() 45 6.5 Bearer Token request 46 6.6 Formation of a data request 47 6.7 A snippet of the updateRecords() method. 48 7.1 Script to schedule the integration 51 7.2 Scheduled Jobs interface 52 ix Introduction Customer Relationship Management systems or better known by their abbreviated phrase CRM are considered useful tools used by numer- ous managers and salespeople across multiple industries. The purpose of this thesis is to introduce CRM platforms and later focus on Salesforce, the CRM market leader of 2019 via an author Salesforce application created for integrating a 3rd party data source into Salesforce. In chapter 1 we will introduce CRM platforms and explain their relevance in terms of user adoption and market share. We will continue in the chapter 2 with the introduction of Sales- force, the CRM market leader of 2019 and elaborate on the technical and community specifics of this platform. Concluding the theoretical part of the thesis, we will cover potential implementation approaches of 3rd party integrations in the chapter 3. In chapter 4 we will introduce the case study of an author integra- tion which was developed for the LeanTaaS company by Jakub Hančin in the autumn of 2019. We will elaborate the introduction by moving to a required pre- development setup of Salesforce in the chapter 5. Once the objectives of the LeanTaaS project and the pre-requisities of Salesforce development are thoroughly explained we will continue with analysis of the implementation in the chapter 6. After an explanation of the implementation, we will conclude the practical part as well as the whole thesis with post-development requirements of Salesforce and the project conclusion. 1 1 CRM platforms introduction 1.1 What is a CRM Customer relationship management (CRM) is the combination of best practices, strategies and technologies that companies use to manage and analyze customer interactions and data throughout the customer lifecycle.