Tag Archives: Apex

Get key prefix of an object using Apex

Every record in Salesforce has an ID which is used to uniquely identify the record. Each ID value is globally unique. The first three digits represent the object type. For example, the Account object uses the 001 prefix; the Note object uses the 002 prefix, Contact uses 003, Users 005, Opportunity 006 etc. We can… Read More »

Delete apex class or trigger in Salesforce Production Org

It is not possible to directly delete an Apex class or trigger after it has been deployed to production. A quick workaround to delete or disable Apex Class/Trigger is by using eclipse and Force.com IDE. Here are the steps – Download Force.com IDE. Connect to the salesforce production org. Download the apex class/trigger. Open the… Read More »

Consuming External Web Service in Apex

While developing applications in force.com, there may be a requirement where we will need to consume external web service. There are many external websites which provide service and which can be consumed from our applications. One of the features we have in Salesforce is that we can easily consume External Web Services. Greytrix Releases First… Read More »

Prevent page redirection on Apex Command Button through JavaScript

We had a requirement to add client side validation on Apex Command Button but the page was getting redirected after successful validation. So, we tried the following JavaScript code to prevent the page redirection but it didn’t work.We then found a solution to stop redirection by adding the following code at the Command Click Event.… Read More »