Skip to main content

Posts

How to Export Excel Files from Salesforce Using ExcelJS

You might expect that creating an Excel file in Salesforce would be easy — perhaps even supported natively. But as with many things in the life of a Salesforce consultant, it’s often not that simple. In general, you have three options for exporting Excel files: Do it in the frontend Do it in the backend (Apex) Do it ou>sforce altogether When to Use the Frontend Approach The frontend (JavaScript-based) method is ideal when: You don’t need to store the file in Salesforce You want to avoid hitting Apex CPU or heap size limits You want an easy, lightweight solution All you need is a JavaScript file with a library like ExcelJS uploaded as a static resource. It’s straightforward, efficient, and avoids unnecessary backend processing. When to Use the Backend Approach If you need to store the file in Salesforce, generate it on a schedule, or integrate with server-side logic , then Apex is your go-to. Here's a good example using Apex and ZIP-based Excel file reading: Sal...
Recent posts

How to create Histogram in CRM Analytics

Salesforce CRM Analytics unfortunately doesn't provide a histogram widget out of the box. However, it is possible to use column chart to achieve acceptable results. Additionally, I will explain how to calculate the average price per Product and country, or per Product and Account . For how much are we actually selling? It is not uncommon to offer a discount to a potential client in order to win an Opportunity . When doing so, sales managers are interested in seeing the actual prices at which products are sold as well as the average price of the product sold in the country and to the same client in the past. To be able to follow the steps below, you need to have Salesforce CPQ installed on your org. Average price per country Let’s start with calculating average price. For this we will use Net Value on the Quote Line related to Accepted Quotes . First, we will prepare the Quote Lines . Open Data Manager and add following objects to Connections : Ac...

How to manage multi-currency in Salesforce CRM Analytics

While multi-currency support in Salesforce is very robust, CRM Analytics doesn't support multi-currency whatsoever. In the following article, I will explain how to display amounts in the corporate currency, record currency, user currency, as well as to implement currency picker that recalculates amounts based on user selection . For the purpose of this demonstration, I have set EUR as the corporate currency, activated multi-currency (both in Setup -> Company Information) , and added CZK to the list of active currencies (Setup -> Manage Currencies) . Advanced Currency Management is turned off ( Dated Exchange Dates are not considered). Default behavior Let's start with a description of what's going to happen with currency-type fields in CRM Analytics if we don’t make any modifications. When CRM Analytics accesses the data, it always happens in the context of Analytics Integration User . As a result, the sync converts all of the currency-type fields into ...

How to visualize months as names in CRM Analytics

It is sometimes desirable to display month names instead of month numbers in your charts. Month numbers can be especially confusing when you are using fiscal years. For example "2024-01" ... Is it January? Or is it July, when the company= fiscal year starts? As obvious as it sounds, it is not easy to achieve this in Salesforce CRM Analytics . There are two ways to achieve this: using a recipe or employing SAQL (Salesforce Analytics Query Language) . Two ways to skin a cat To showcase both techniques we will visualize Opportunity expected amounts grouped by year and month. In the first method we will use a recipe to create an extra field with a month name . In the second method we will include case method into the query itself . Recipe We require data from Opportunity object , specifically Close Date and Expected Amount fields. Create a Connection and synchronize the data. Create a new Recipe with Opportunity connected dataset as an input. Add a transfor...

About author

My photo
Jan Binder
Experienced Salesforce Technical Architect and Team Lead with a proven track record of delivering successful enterprise projects for major global companies across diverse industries, including automotive, oil & gas, and construction.