visualforce

New Apex Method | Extracting Picklist Values Based on Record Type Inside Apex

New Apex Method | Extracting Picklist Values Based on Record Type Inside Apex

For years, Salesforce developers have faced a common challenge: programmatically retrieving picklist values that are specific to a certain Record Type directly within Apex. The “solutions” often involved either complex SOQL queries against metadata, relying on the UI API (with its associated callout limits and serialization overhead), or maintaining clunky custom metadata/settings.

Good news, Technical Potpourri readers! The Salesforce Spring ’26 release is bringing a game-changer that will significantly simplify your Apex code and improve performance: native Apex methods to filter picklist values by Record Type!

read more...
Apex Cursor and Its Advantages Over Batch Processing

Apex Cursor and Its Advantages Over Batch Processing

Struggling with large datasets and SOQL governor limits in Salesforce? In this video, I will dive deep into Apex Cursors, the powerful new feature that revolutionizes how we process millions of records.

Apex Cursors allow developers to navigate through query results in manageable chunks within a single transaction or across Queueable jobs. In this video, I will show you the correct way to implement Apex Cursor and also when this is an exception, how to handle that and perform retry.

read more...
Write Mock SOQL Tests For External Objects

Write Mock SOQL Tests For External Objects

When we write any Apex class which involves some sort DML operation around the External object, we need to write the test classes as well. Writing test class is needed to make sure atleast 75% of the code is covered in the test class with both positive, negative and bulkified scenarios. In case of SOQL statements, we normally create the test data in the test setup method and query them in the test methods. But in case of SOQL which involves External object, we can not do that and also we can not directly query the External objects. But test coverage is needed for the Apex class to be deployed in Production.

In Winter 25 Release, Salesforce brings the solution to this problem. Now we can write mock SOQL statements for External Objects.

read more...
Restrict Uploading Files In Salesforce

Restrict Uploading Files In Salesforce

While working in Salesforce, we sometimes come up with the requirements where we need to build some sort of validation to restrict uploading files with specific extensions or in other words, allow only approved file types/extensions. This is very important because uploading executing or javascript code can bring potention security concerns by exposing internal data to outside world.

So allowing only certain type of files for upload is a very common requirement. In this blog post, I am sharing couple of solutions with pros and cons to implement this requirement.

read more...