How to get a specific Salesforce domain?

With the recent Salesforce transition to Enhanced Domains the question of how to reliably get a specific Salesforce domain (e.g. for Lightning or Visualforce) is getting raised more often than before. In this post I will shortly present a very helpful class that was released in Spring ‘22 that will be the go-to answer to this question in the future.

Read More
apex
utility

Word-wrap not working in Visualforce PDF

Not too long ago I was asked to support with some PDF rendering issues in one of our projects. In particular we were facing two common problems - word-wrap not working in Visualforce PDFs, and the loss of styling when using “Arial Unicode MS” font family.

I plan to write two blog posts about these problems with the solutions we implemented to get around them. This first post will be about the issue with word-wrap: break-word not playing nice.

Read More
visualforce
pdf

Delete a Sharing Rule via Destructive Changes

Recently a colleague of mine had difficulties with deleting a Sharing Rule with our CI/CD solution. I tried helping him and saw that it’s not that easy to do it, so I decided to document the process in this blog post.

Read More
ci/cd
deployments
destructive-changes

Einstein Analytics Translator

In this post I’ll share with you how you can use a CSV file, like the one in the screenshot below, to easily translate Einstein Analytics dashboards.

csv_sample

Read More
analytics

Automatic Email Template Selection in Case Feed

Specifying default values, based on certain criteria, when sending an email message from the Case Activity Feed sounds like a pretty standard requirement. However, for some reason, I struggled a bit with finding a solution to this problem, so I decided to document it here.

Read More
apex
lightning

Export Reports in Salesforce Lightning as a CSV file

If you need to export a report as a CSV file in Salesforce Lightning experience, this is a post for you. There is a simple URL hack that many people used (abused?) in Salesforce Classic to achieve this, but for many this hack stopped working after the migration to Lightning.

Read More
reports

Post to Chatter from Process Builder with hyperlinks to records

In Summer ‘18 Release Salesforce provided a way to “link to your most relevant records from a Post or Comment” in Chatter. This feature can be used directly while typing in Chatter, or from Apex code, however, they haven’t provided an out-of-the-box way to do this from declarative tools such as Process Builder or Flow. In this post I’ll provide a way how you can use these tools to easily post something similar to what I did in the picture below:

chatter_post

Read More
process-builder
flow
apex
chatter

Get Record Type Id by Developer Name

Salesforce has finally provided us with a way to easily get Record Type Id by Developer Name, without using a SOQL query. This new feature comes with Summer ‘18 Release and it should help us write more efficient and reliable code.

Read More
apex

Lightning Pills Input Component

In this post we’ll create a custom Lightning component which breaks down the input and utilizes Salesforce lightning:pill components to display the results. You can see a sample of this component in the image below:

pills_input

The component will also be able to validate the provided input upon entering, and will prepare it for saving to database. So, let’s get to it.

Read More
lightning

Sorting Salesforce Records with JavaScript

In a previous post I’ve shared with you a JavaScript function that I’m using in order to easily access object’s properties that go from 1 to n levels of depth. Now, I’ve decided to extend on that post, and show you how I’m using the same method to achieve the JavaScript array sorting using dynamic properties.

Read More
javascript
visualforce
utility

Accessing Salesforce Record Fields with JavaScript

I wanted to share with you a utility function that I’ve created and stored in my Static Resources. I’m using this function to dynamically access fields from JavaScript objects that represent Salesforce records obtained by sforce.connection.query or Remote Action. Here’s the function below:

Read More
javascript
visualforce
utility

Make a Managed Visualforce Page show Header and Sidebar

Let’s say you’ve installed some managed package to your org and there’s a visualforce page in this package that doesn’t include header and sidebar . You need to redirect your users to this visualforce page, but the page breaks the look and feel by hiding the Salesforce header and sidebar. You can’t access or change the managed package’s code, so what else can you do?

Read More
managed
visualforce

apex:commandButton with Return Value

Below you can see a sample code that can be used to return a value from an Apex controller to a Visualforce page when calling a controller function from an apex:commandButton. This approach doesn’t require you to use @RemoteAction (i.e. static methods), so you doesn’t lose the stateful nature of your page, and your controller’s method can access all the variables within that controller instance.

Read More
apex
visualforce

Array Filter

Recently I needed a way to quickly filter out an array (i.e. list) of sObjects in Apex. Since I was a C# developer for 5 years, I immediately remembered how I used LINQ in C# for this purpose and I hoped there’s something similar in Apex as well. However, in Apex, there is no easy way to filter through a list without using the for loop.

Read More
apex

Time-Dependent Workflow that triggers in less than 1 hour

As you probably know, Salesforce Time-Based Triggers can trigger before (or after) certain number of days (or hours) from a specified Date/Time field on the record that triggered the workflow. The valid range is 0 to 999 days or hours, and you can’t use decimal values, only integers. This means that out of the box you can’t, for example, make a workflow be triggered 15 minutes or half an hour after the rule was evaulated. However, in case you really want to do something like this, there is a workaround.

Read More
workflow

Run Time-Dependent Workflow on every record edit

If you ever wanted to create a Time-Dependent workflow rule that will be triggered every time a record is edited, your first instinct was probably to create a rule that is evaluated when a record is created, and every time it's edited. However, as the image below shows, you cannot add time-dependent workflow actions with this option.

Read More
workflow

About me and this blog

My name is Miroslav Smukov, I’m from Serbia, and I’ve been a professional software developer since 2010. For the majority of my career I’ve been developing desktop applications with C# and .NET Framework, but I always like to experiment with other fields and technologies so I had some professional experiences with Web and Mobile development, Kinect and Leap motion sensors, Unity3d and others, during 60+ projects I completed as a freelancer. However, this isn’t supposed to be my CV, so if you want to know more about my past work you can checkout my LinkedIn profile.

Read More

Filter by tag: