How to Write a Test Class For an Apex Trigger in Salesforce

Test Class For an Apex Trigger in Salesforce

As a Salesforce Developer, I needed to automate a process using an Apex Trigger. The trigger automatically creates a contact record whenever the sales team creates a new account for a customer. I wrote a test class to ensure the trigger works as expected and the trigger code is error-free. This test class also verifies … Read more >>>

How to Reverse a String in Salesforce Apex

Reverse a String with Array method in Salesforce Apex

While working as a Salesforce developer, I had to build custom sorting logic for a Salesforce application in which email addresses needed to be sorted based on their domain, but in reverse order. For this requirement, I used the Salesforce Apex in-built reverse() method. In this Salesforce tutorial, I will explain how to reverse a string in … Read more >>>

Restrict Users From Switching Salesforce Lightning to Salesforce Classic

How to restrict a user from switching Salesforce Lightning to Salesforce Classic in Salesforce

Recently, we have migrated our Salesforce org to the Lightning experience, and the management wanted all sales and service users to stay in Lightning. However, some users were still switching back to Salesforce Classic, which created problems. For example, the sales operations team began building dashboards using Lightning-only features. However, a few sales representatives continued to … Read more >>>

Stacked Bar Chart With Multiple Measures in Tableau

Add Label to measures in Tableau Stacked Bar Chart

Recently, we were analyzing the sales performance of our products in different regions. For this, we were using metrics (measures) such as Sales, Profit, and Quantity. To compare these measures side by side within each category, we created a stacked bar chart in Tableau using multiple measures. Our dimension was Region, and we used Sales, … Read more >>>

How to Convert DateTime to Date in Salesforce Formula

Convert DateTime to Date in Salesforce Formula

In Salesforce, DateTime fields always include both the date and the time, for example: 28-Aug-2025 3:45 PM. However, in many business scenarios, users only need the date. For example, we want formulas that require comparison with TODAY(), such as checking if a follow-up DateTime matches today’s date. Since TODAY() only returns the date, you need to convert … Read more >>>

Visualforce Page in Lightning Web Component

Integrate a Visualforce page with LWC in Salesforce

In Salesforce LWC development, we can use the Visualforce pages inside the Lightning Web Components. For example, you have created a contact form using Visualforce pages. To use that form in LWC, we can embed that Visualforce page using the <iframe> tag and the visualforce page URL as src within the LWC. In this Salesforce … Read more >>>

How to Replace String in Salesforce Apex

How to replace two characters of a String in Salesforce apex

While working as a Salesforce admin for an organization that tracks leads from multiple sources, I noticed inconsistencies in the Lead Source data. Instead of the web, it was entered as a website, so I had to replace the current lead source value with the web. To do this, I used the built-in Salesforce Apex … Read more >>>

How to Convert Integer Data Type to Decimal in Salesforce Apex

How to Convert Integer Data Type to Decimal in Salesforce Apex

While working on Apex in Salesforce, I created a field that stores the total price of products as an Integer representing the amount in rupees. To display this value to the user, I converted it into a decimal format representing dollars. Here, I will explain why we need to convert integers to decimals. Then, using … Read more >>>