ABSYZ ABSYZ

  • Home

    Home

  • About us

    Who We Are

  • Our Expertise

    What we Do

  • Our Approach

    How We Do It

  • Products

    What We Made

  • Industries

    Who We Do It For

  • Clients

    Whom We Did It For.

  • Article & Blogs

    What Experts Think

  • Careers

    Join The Team

  • Get In Touch

    Let’s Get Started

ABSYZ

Archive of Salesforce data

Home / Article & Blogs / Salesforce / heroku / Archive of Salesforce data
By Pradeep Chary inheroku, Java, Salesforce

The Salesforce has many regulatory limits and one such is Data Storage. As the CRM ages, it accumulates large amounts of information and many enterprises eventually run into data storage limitations. Purchasing additional Salesforce storage space is not economical when you add the operational burden. To overcome this challenge a comprehensive archiving mechanism is recommended and is an essential part of every progressive business.

What is Archiving?

Archiving is transferring the data to a less frequently used storage medium. Archiving enables organizations to create and retain more data than ever before.

Why data should be archived in Salesforce?

An archive includes historical, rarely-used Salesforce data that can be entirely removed from your Salesforce environments. Upon archival, the data is moved to long-term retention and can be used for future reference. Data archiving

  • Allows only to use Salesforce provided storage limits.
  • Reduces storage costs and increased storage limits for relevant data.
  • Keeps your customer sensitive data safe.
  • Consistent application performance.

Does Salesforce provide Archival mechanism?

The answer is yes, Salesforce has a built-in archiving capability. It is limited to tasks, events, and activities that are older than a year and this doesn’t count against your company’s storage allocation. Salesforce doesn’t address other huge objects data that should be archived depending on the business process. Another option that Salesforce proposes for archiving is Big Objects, which has its own advantages.

Are there any third-party vendors that provide archival functionality for Salesforce?

Yes, there are vendors, one such is DataArchiva, it gives a lot of options to choose storage like AWS, Azure, Heroku, etc. The pain part is, it comes with pricing.

Challenges for Archiving data in Salesforce

Approach
Challenge
Building the application on the Force.com platform using the Zippex library.This works only for the total file size of less than 3MB.
Building the application on Force.com platform using javascript libraries in the Visualforce page.This solution cannot run in the background as a scheduled job.
Hosting the above-mentioned application on the site page and invoking site page through the batch apex.Javascript code of Visualforce page is not compiled and as a result no execution of Archival Logic.

Now let’s see an Economical, limitation less solution for the Archival of Salesforce data.

APIs are always there to enhance a platform and based on this the solution is implemented to overcome the platform limits. This blog provides the solution for Archiving large files using the Salesforce REST API and Java Application hosted on Heroku. 

Solution Architecture

ArchivalBlogg.pngThere will be three entities in the solution

  1. Salesforce
  2. Java Application
  3. Online file storage web service (here AWS Glacier)

The Salesforce data is pushed to AWS Glacier via Java Application. In order to archive a specific record, the approach would be 

  1. Get the HTML view of the record in a content document.
  2. The Java Application will connect to Salesforce and get the content versions, convert the HTML page of record to PDF/A, zip them and upload the zip to the glacier.  In simple we are Wrapping PDF of the record and its related files together and putting them in the glacier.
  3. Glacier gives back a response Id for every zip file you insert. Store this Id in the Salesforce or any other database.
  4. Use this Id to retrieve the data when you need it for any evidence.

Note, to get the HTML view of the record to create a custom Visualforce page that shows all the data of the record along with related lists and chatter, and convert that VF page to HTML dynamically.

Since the Force.com platform has limitations, we are moving the logic of processing files to another open-source platform like Java and performing necessary operations and inserting back the result to Salesforce through API. This Java entity can be hosted on any PAAS like Heroku. It can even be scheduled to make Archival an automated job.

Steps to connect to Salesforce from Java application

  1. Create a basic connected application in Salesforce, and select the OAuth Scopes to Access and manage your data (API)
  2. Once the connected app is created, note the consumer key and secret key.
  3. Configure OAuth2.0  authentication.
  4. Once Authentication is successful, using the Oauth token you can communicate with Salesforce. Make the required queries to get the files from the Salesforce.

Note, instead of making multiple callouts from the external application to get the content version Id (File Id), populate the contentversionIds in a field on the record using SOQL in Salesforce.

Criteria for Archiving a record

It can be defined at the org level or object level or record level. If it is at org level or object level, a custom setting can be created with a field that stores the Archival Period. If you want to use it for org level, create a single record with the archival period, and if you want to use it for object level, create a record for each object specifying the archival period. If you want at the record level, then just create a field on every object that stores the Archival Period. Note, data satisfying this Archival Condition only should be queried from Java.

Zipping in Java

Once we query all the files under a record which includes HTML also,  keep them in a folder with the name as Record Name. Before placing the files convert the HTML page of record to PDF/A. Now, this folder can be  Zipped using any of the libraries present in java. For reference use this link

Sending it to Cloud storage (here AWS Glacier)

Here we can leverage the Java language, cause whatever cloud storage you choose, there will be some material available online where we can easily get the code in Java to connect to that storage. For AWS Glacier refer to this link.

This uses SDK to connect to the glacier, and integration becomes pretty simple with this SDK.

Now we have a fully working application, the question is where do we host it. If you choose Heroku as a platform to host follow the below steps.

  1. You will require a one-off dyno to host it and to be scheduled.
  2.  For scheduling instead of using the Heroku scheduler, use the custom clock process in Java, refer to this link.  

Want to implement an economical archiving solution for your Org then get in touch with us.

ArchiveHerokJavaWebApplicationOnHerokuRESTSalesSFDC
174
Like this post
3 Posts
Pradeep Chary

Search Posts

Archives

Categories

Recent posts

All About The OmniStudio FlexCards

All About The OmniStudio FlexCards

Boost Customer Experience With Repeater Widget in CRM Analytics

Boost Customer Experience With Repeater Widget in CRM Analytics

Enhance Insights Using Custom Tooltips In CRM Analytics

Enhance Insights Using Custom Tooltips In CRM Analytics

Net zero as a Service In CPG Industry

Net zero as a Service In CPG Industry

How Do We Import an External Library into Salesforce Lightning?

How Do We Import an External Library into Salesforce Lightning?

  • "Giving back” is at the Heart of ABSYZians - ABSYZ CSR
    Previous Post"Giving back” is at the Heart of ABSYZians - ABSYZ CSR
  • Next PostOutlook connection with Salesforce through custom Objects

Related Posts

All About The OmniStudio FlexCards
OmniStudio Salesforce

All About The OmniStudio FlexCards

Boost Customer Experience With Repeater Widget in CRM Analytics
CRM Analytics Salesforce

Boost Customer Experience With Repeater Widget in CRM Analytics

Enhance Insights Using Custom Tooltips In CRM Analytics
CRM Analytics Salesforce

Enhance Insights Using Custom Tooltips In CRM Analytics

How Do We Import an External Library into Salesforce Lightning?
Lightning Salesforce

How Do We Import an External Library into Salesforce Lightning?

2 Comments

  1. prasadvivekkothalanka
    Reply
    26 July 2019

    Amazing Information

    Reply
  2. NagaSai
    Reply
    26 July 2019

    Good content

    Reply

Leave a Reply (Cancel reply)

Your email address will not be published. Required fields are marked *

*
*

ABSYZ Logo

INDIA | USA | UAE

  • About us
  • Article & Blogs
  • Careers
  • Get In Touch
  • Our Expertise
  • Our Approach
  • Products
  • Industries
  • Clients
  • White Papers

Copyright ©2022 Absyz Inc. All Rights Reserved.

youngsoft
Copy
We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “ACCEPT ALL”, you consent to the use of ALL the cookies. However, you may visit "Cookie Settings" to provide a controlled consent. Privacy Policy
Cookie SettingsREJECT ALLACCEPT ALL
Manage consent

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled

Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.

CookieDurationDescription
cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.

Functional

Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.

Performance

Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.

Analytics

Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.

Advertisement

Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.

Others

Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.

SAVE & ACCEPT