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…

How to implement dynamic bar charts using Visualforce Charting ?

Visualforce charting help developers to implement customized business charts based on the data sets created directly from SOQL queries, or by building the data set in Apex code. We can use any chart provided by Salesforce like bar, line, area, and pie charts commonly used in business graphics, as well as radar, gauge, and scatter charts for more specialized charting….