How to Compare Two DateTime Values in Salesforce Apex

Compare Datetime fields in Salesforce Apex using Sort method

In our Salesforce org, the sales team needs to create follow-up tasks for opportunities that were closed within the last 30 days. To determine whether an opportunity was closed within the last 30 days, we need to find the difference between the closed date and the current date. As a solution, I created an apex … Read more >>>

How to Convert Date to DateTime Format in Salesforce Apex

Convert custom date to datetime in Salesforce Apex

While working as a Salesforce developer, I got a requirement from the sales team for our organization regarding the data type conversion of an object field. The sales team wants to track opportunities that are closing soon. The Opportunity Close Date is stored as a DateTime field, but the team only wants the date (without … Read more >>>

How to Create Record Trigger Flow in Salesforce

salesforce flow

I worked as a Salesforce administrator. Recently, the sales manager has sought to automate the process of updating the opportunity stage, which is automatically set to ‘Closed Won’ when the amount exceeds $ 100,000. To do so, we utilize Salesforce Flow, a powerful automation tool. In this Salesforce tutorial, we will learn how to create a record trigger flow in … Read more >>>

How to Generate the Random String using Apex in Salesforce

Salesforce Apex generate random 10 digit string

I recently worked on customer support cases in our Salesforce org. To manage case tracking and ensure each case has a unique identifier, we have to generate a random alphanumeric reference code for each new case. Customers will use this code to reference their case in communications. To solve this, I created an apex class … 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 >>>

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 Create Custom Buttons in Salesforce

Create Detail Page Button in Salesforce

I worked as an admin for a company that used Salesforce. The sales team wanted an easy way to search Google for information related to their accounts without having to open a new browser tab. To simplify their task, I decided to add a custom button to the account object that redirects to Google and … Read more >>>

How to Convert String to Datetime in Salesforce Apex

Converted datetime from string in Salesforce apex

In our Salesforce org, we have a custom form field where users manually enter the date and time for follow-up meetings. The input is captured as a string from a custom form field. We need to convert this string input into a Datetime format so that we can create a follow-up event in the system … Read more >>>