Salesforce provides couple of developer related objects which are very useful when a developer wants to fetch the metadata information of apex class, components, pages, triggers, code coverage using apex code. There are lot of scenarios where we can utilize these objects :- To search any referenced fields and objects inside apex classes,pages & triggers….
Salesforce Tweaks using Chrome Plugins
Admin/Developers spend lot of time in opening, searching, navigating, analyzing, assigning permissions on setup or non setup items using Salesforce standard functionality. There are couple of plugins for developers- Salesforce advanced Code searcher 1. Search for any code inside Apex Class, Visualforce page, Triggers etc. 2. Find and open any Class, Visualforce, Triggers, Components, Templates. 3. Extract Code Coverage. To speed…
Salesforce – Deployment Tools, Best Practices & Faster Deployment
When you are ready to deploy your changes to Production, a developer can use various tools to move metadata from one organization to another: Change Sets: The most frequently used tool for deployment when you want to send customizations from your Sandbox to Production org. This requires a deployment connection to be established between Sandbox and…
What is Dynamic Apex in Salesforce and how to use it ?
Dynamic apex enables developers to create more flexible applications by providing them with the ability to “Access sObject and field describe information”, “Write Dynamic SOQL Queries”, “Write Dynamic SOSL Queries” and “Dynamic DML”. It consists of several components such as schema describe, dynamic SOQL, dynamic SOSL, and dynamic DML. 1) Access sObject and field describe…
How to call Rest Service using OAuth REST API ?
We created a REST Service in Salesforce in our previous blog, and now we want to call the REST service from another application. Salesforce DO NOT allow using Basic Authentication (Username & Password) for incoming REST calls. This is still true even if you are calling from another Salesforce instance. We have to use OAuth to authenticate…
How to create and use Apex Rest Services in Salesforce ?
The Force.com REST API lets you integrate external system with Force.com applications using simple HTTP methods, in either XML or JSON formats, making this an ideal API for developing mobile applications or third party applications. Following are the benefits of using the REST API in your integrations: Easy Access: Use standard HTTP method call-outs, available on…
How to write test class for Apex Rest Services ?
A Developer wants to push the rest service to production which requires a code coverage as per the deployment strategy and best practices of salesforce. In this scenario, we must create a test class to test the rest services Rest Service Class:- @RestResource(urlMapping=’/Account/*’) global with sharing class AccountService { @HttpGet global static Account doGet() {…
How to write test class for Batch Apex in Salesforce ?
We should always test batch class with good amount of data (minimum 200 records) in our test class. Here is the example of batch apex testing. In below code, we are updating name of all accounts with “Updated” keyword in the last of account name. Batch Class: global class AccountUpdate implements Database.Batchable { global Database.QueryLocator…
Making Callouts for Long-Running requests using Continuation object in Salesforce ?
Sometimes we may encounter webservice callouts in business scenarios that will take longer to respond. This is because the other end need to do significant amount of work prior to responding back. if the other end process huge number of transactions during peak loads, the response will be even slower. Salesforce has a governor limit of maximum of 10…
How to Disable or Delete an Apex Trigger or Class from Production Organization ?
Apex code can’t be modified directly within a Production organization, so it requires steps using Developer tools, like the Force.com IDE. Steps to Remove or Disable Apex Classes/Triggers 1. Force.com IDE should be installed. 2. Connect to the Production Instance using the IDE and find the class or trigger that you want to delete. 3. Open…