Girikon’s Salesforce Consultant provides the right advice in managing your Salesforce Org’s storage.
Published: 2019-05-02 14:35:27

---
title: Girikon’s Salesforce Consultant provides the right advice in managing your Salesforce Org’s storage.
published: true
description: Salesforce is one if the leading CRM platforms used across the globe. According to Girikon’s Salesforce Consultants it is one of the largest and widely used CRM software in the market.
---
 

Salesforce is one if the leading CRM platforms used across the globe. According to [Girikon’s Salesforce Consultants](https://www.girikon.com/salesforce-consulting-services/) it is one of the largest and widely used CRM software in the market. Salesforce has two types of storage i.e. Data storage and File storage. File storage includes attachments, items a user has uploaded into the Documents tab, and Salesforce CRM Content. Contact Manager, Group, Professional, Enterprise, Performance, and Unlimited Editions are allocated 10 GB of file storage per org. Essentials edition is allocated 1 GB of file storage per org. All other data, including activities is considered a record and counts towards your Data Storage allocation. Data Storage limits for every Contact Manager, Group, Enterprise, Professional and as well Performance editions are calculated at either 1 GB or on a per user limit (20 MB per user) whichever is required for production orgs. For a business keeping their expenses in check keeping an eye on storage limits is the main goal. 

We all agree that Salesforce is a great CRM but when it comes to licence pricing it can get very expensive when you consider licence per users etc. If the organisation’s concern is storage cost and the users are continually uploading data at an alarming rate, then it is important to apply Girikon’s strategy for managing the orgs data. Emails and Cases are very crucial pieces of information and they can take up a lot of space. Each email takes around 2Kb – 10Kb data (it varies on a case by case basis depending on the email content) and each attachment sent alongside the email can be up to 20Mb. Management of the orgs data can be more effective by managing by archiving and then restoring the emails when needed. 
The Archiving strategy is very simple, and it has proved to be very effective. Our Salesforce Consultancy Services team often advise users to use the two custom buttons which are Archive and Retrieve which does all the work for the users. When clicking on archive, the emails in the related list gets archived or gets stored as an attachment.

<li><strong>Before sending or receiving the email.</strong></li>
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/37deozzn10fwewk3zme3.png)

<li><strong>After sending the email.</strong> The email is showed in the email related list and the data storage is increased</li>
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/m174ced9pz81dh9pplge.png)
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/ukbfvafz12raibjcpqz3.png)
<li>When the archive button is clicked.</li>
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/51bnc236ez7a2d06kerd.png)

A visual force page pops up to ask you that “Are you sure you want to archive?”
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/4q8vy0xn8r772bhl55yq.png)
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/dhb6qwdbwflmm737m2hd.png)
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/ue7kqvkt9j97gt7gx878.png)

Let us explore the backend logic behind the storage when an email is sent or received, it creates a record in emailMessage object and the attachments along with that email creates a record in attachment object in salesforce. The record that is created has a parent Id equals to the case Id and the attachments that were sent along with that email have their parent Id equal to the email record Id. So, when we hit on archive button the code runs in the background which creates a new record or file i.e.  email(emailId).txt in the attachment object which have the email and its details such as: - BccAddress, CcAddress, TextBody/HTML body etc. And for the attachments that were delivery with the email, the parent Id of those gets re-parented and now is equal to the caseId. After that the email record in the emailMessage Object gets deleted which reduces the Data Storage.
Email retrieving is also necessary after the user has archived as per the step above to be viewed at a future date. There is also an opportunity for the user to delete the emails.

<li>Click on retrieve button.</li>
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/65qzajpgonbiss8b6138.png)

<li>A visual force page pops up and asks, “are you sure you want to retrieve?”</li>
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/7gj9g3hx25k139tn2p4z.png)

<li>The email is retrieved. And the data storage is increased.</li>
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/a5flvygsdcw0x30sllhb.png)
![Salesforce Org’s storage](https://thepracticaldev.s3.amazonaws.com/i/t99fbfl5bnlaihgok5to.png)

Let us explore the backend logic behind the storage when an email is retrieved. Code is written in such a way that it reads body of email(emailId).txt and then creates a new record in the emailMessage object from it. For the email attachments, they are again re-parented back to the email with the help of a custom field which the system created in the emailMessage Object to retrieve the attachments. The custom field contains the old Id of the email when it was not archived. After all this is done the code deletes the email(emailId).txt file from the attachments.

<strong>About Girikon</srong>

Girikon is a Silver [Salesforce Consulting](https://www.girikon.com/salesforce-consulting-services/), Oracle Gold, Microsoft Application, Abode Bronze Technology Partners. We are also ISO 9001 Quality Management and ISO 27001 Data Management system certified.  Girikon's Headquarters are in the US, with offices in AUS and Technology centre in Noida India with over 150 employees across the three offices. Girikon is a Salesforce Consulting Company that provides cost effective services through a hybrid offshore/onshore model, quality delivery and great testimonials.  



tags: salesforce storage