Blogs
-
Usage of Custom Labels in Apex Code Within Salesforce
Example of Utilizing A Custom Label in Apex Code Within Salesforce In Apex code within Salesforce, we utilize System.Label.labelName to access custom labels. These custom labels serve as custom text values that can be accessed from both Apex classes and Visualforce pages. They allow for translations into multiple languages supported by Salesforce, enabling the presentation…
-
Comparing Old And New Field Values In A Salesforce Trigger
Occasionally, there’s a requirement for a trigger to execute only when specific field values on a record change. To ensure the trigger operates solely when necessary, it’s crucial to compare the value of that field between the old and new versions of the record. For instance, there might be a need to send an email…
-
Random Number Generation In Apex Salesforce
Often, there’s a need to generate random numbers in Apex. This can be accomplished using the Math.random() function, which produces a positive Double value between 0.0 (inclusive) and 1.0 (exclusive). However, as this method solely generates numbers within the range of 0.0 and 1.0, it’s crucial to understand how to modify these numbers to suit…