How to Convert Date to String in Salesforce Apex

Salesforce convert date string in 'yyyy-mm-dd' format

While working as a Salesforce developer, I created a report that displayed the last activity date for each account. The LastActivityDate field in Salesforce is a Date type, but I wanted to display it as a formatted string, such as “October 1, 2024” in a custom email notification. To achieve this, I converted the Date to a … Read more >>>

How to Convert ID to String in Salesforce Apex

Convert Id to string in Salesforce apex

While working as a Salesforce developer, I recently converted data types for some object fields. There was a custom object called User_Activity_c. This object has a field Related_record_c to store the record’s ID associated with the activity. Since the Related_Record__c field is a text field, I had to convert the ID type to a string … Read more >>>

Enable and Create Recurring tasks in Salesforce

Create recurring tasks for quarter in Salesforce

While working as a Salesforce system admin, I received a request from the Sales team to enable the recurring tasks. The sales team managed opportunities, with each open opportunity requiring a follow-up call from the sales representative every week until the deal was closed. Instead of manually creating follow-up tasks, they opted for recurring tasks … Read more >>>

How to Use Switch Statement in Salesforce Apex

In the recent Salesforce Apex development, I assigned priority levels to customer support cases based on their issue type, such as “technical,” “billing,” etc. I had to assign a priority to each case, like “high,” “medium,” or “low,” based on the issue type. I could have used if-else statements, but management handled multiple issues throughout … Read more >>>

Get Picklist Value In Salesforce Apex Class

How to get picklist values in Salesforce apex class

Recently, I worked as a Salesforce developer for an organization that manages multiple office locations across different countries. The company uses a custom Salesforce object called OfficeLocation__c to store details about each office location, such as its address, city, state, and country. The Country__c field on the OfficeLocation__c object is a picklist that stores the … Read more >>>

Convert a String to Decimal in Salesforce Apex

Salesforce apex Convert string to decimal list

While working as a Salesforce developer, I recently fixed an issue related to the input product pricing field data type. In the Salesforce application, there was a lightning component where the user could enter the product price, and by default, the input field was a string. To perform calculations with the entered value, such as … Read more >>>

How to Get Current Datetime in Apex Salesforce

How to get my correct current local time in Apex

The organization where I work as a Salesforce developer has a global Salesforce implementation with users in multiple time zones. When scheduling tasks or reminders, it’s crucial to ensure that each user creates these events at the correct local time. When a user logs in to Salesforce, the system must display the current time and … Read more >>>

Convert a String to an Integer using Apex in Salesforce

Salesforce apex convert string to integer

Recently, while building a custom class for user input in my Salesforce org, where I was customizing the fields for the Contact object, I noticed a custom field ‘age’ in the contact that stores the data in string format. I had to convert this string data into an integer to make it convenient to validate … Read more >>>

How to Find Out when a Report was Last Run in Salesforce?

Find Out when a Report was Last Run in Salesforce

The organization where I work as a system admin uses Salesforce as its primary CRM tool. I have created multiple reports in the past to track the history, activity, and new updates of sales and objects. However, we have noticed that many reports have not been used for a long time and do not align … Read more >>>

live webinar

Build Your First Agentforce AI Agent in Salesforce

We will show demo on the complete process of building your first AI Agent in Salesforce using Agentforce. You’ll learn how agents work and how to connect your agent to Salesforce data to deliver intelligent business outcomes.

Agentforce in Salesforce

DOWNLOAD FREE AGENTFORCE EBOOK

Start with AgentForce in Salesforce. Create your first agent and deploy to your Salesforce Org.