apex random number Salesforce apex random number Salesforce Many time we have requirement to generate random number in Apex. It can be achieved using Math.random() function. This method return a positive Double that is greater than or equal to 0.0 and less than 1.0. This method only returns number between 0.0 and 1.0. Now its important …
Tag: Apex
Permanent link to this article: https://www.sfdcpoint.com/salesforce/apex-random-number-salesforce/
Oct 31
Trigger context variables in salesforce
Trigger context variables in salesforce What are Trigger context variables in salesforce? Trigger context variables in salesforce All triggers define implicit variables that allow developers to access run-time context. These variables are contained in the System.Trigger class. Following are the context variable available in triggers. Please note variable availability in trigger varies according to the type …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/trigger-context-variables-in-salesforce/
Oct 18
Salesforce Interview Questions on Triggers
Salesforce Interview Questions on Triggers In this post I am going to share Salesforce Interview Questions on Triggers What is a Trigger? Apex triggers enable you to perform custom actions before or after events to records in Salesforce, such as insertions, updates, or deletions. Just like database systems support triggers, Apex provides trigger support for …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/salesforce-interview-questions-on-triggers/
Apr 24
TestSetUp method in apex test classes
TestSetUp method in apex test classes @testsetup annotation in test class method Test classes are an important part of overall SDLC in Salesforce. We as a developer have to write the test classes very often, and we need to create the test data as well, to have our test class executed successfully. We’ll cover a new …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/testsetup-method-in-apex-test-classes/
Apr 20
Compare old and new field values in trigger
Compare old and new field values in trigger Salesforce Sometimes we have requirement that our trigger should run only when some field value is changed on a record. So we need to compare value of that field between old version of record and new version of record to make sure that trigger will not run every …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/compare-old-and-new-field-values-in-trigger/
Apr 06
Test class in salesforce with example
Test class in Salesforce with example Test class in salesforce Testing is an important part of SDLC. So, before deploying our code to production environment, Salesforce requires at least 75% of your code to be covered by our test classes whic. Salesforce has done that to make sure that our code doesn’t break in any situation …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/test-class-with-example-salesforce/
Jun 10
Pagination using standard set controller salesforce
Pagination using standard set controller salesforce We can use Standard set controllers provided by salesforce to implement pagination in visualforce. It is very easy to implement pagination using standard set controller. We can easily navigate through pages, move directly to first, last page or to next or previous pages using standard set controller. We can …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/pagination-using-standard-set-controller-salesforce/
Feb 15
Avoid recursive trigger in salesforce
Avoid recursive trigger in salesforce using static variable Avoid recursive trigger in salesforce using static variable Recursion occurs when same code is executed again and again. It can lead to infinite loop and which can result to governor limit sometime. Sometime it can also result in unexpected output. It is very common to have recursion …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/avoid-recursive-trigger-salesforce/
Oct 24
get current record id salesforce
get current record id salesforce apexpages.currentpage().getparameters().get(‘id’) can be used to get current record id or other url parameters in apex code. Many times we have requirement to get current record id or url parameters of visualforce page in apex code. Many times we require the current record id in controller. For example we are redirecting from one visualforce …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/get-current-record-id-salesforce/
Jun 19
custom label in apex code salesforce
custom label in apex code salesforce example We can use System.Label.labelName to access custom label in apex code. Custom labels are custom text values that can be accessed from Apex classes or Visualforce pages. The values can be translated into any language Salesforce supports. Custom labels enable developers to create multilingual applications by automatically presenting …
Permanent link to this article: https://www.sfdcpoint.com/salesforce/custom-label-in-apex-code-salesforce/
Recent Comments