Blog

How to Override the Edit Button Based on Record Type

This is how you can override the Edit action for Book__c custom object. If the record type is Alpha you will be directed to a new page, otherwise you go to the standard edit page.

<apex:page standardController="DaizyLogik__Book__c" action="{!URLFOR(
CASE(DaizyLogik__Book__c.RecordType.Name, 'Alpha', $Page.BookAlpha,
'/' + DaizyLogik__Book__c.Id + '/e?nooverride=1'),
DaizyLogik__Book__c.Id) }">

<apex:variable value=”{!DaizyLogik__Book__c.RecordType.Name}” var=”recTypeName”/>
</apex:page>

by Vladimir Martinov

 

Successful Salesforce implementation with a distributed team

It is becoming more commonplace these days for the team doing the Salesforce implementation to not be physically co-located. In fact, it is very likely that your next Salesforce project will involve a physically distributed team. How can you adapt your project management, design, development and overall project communication style to deliver a project of this nature and be successful at it?

1. Communicate
It is crucial to pick tools that facilitate communication among the team members during regular project meetings and at all times during the course of the project. The choices for online communication tools are quite diverse these days but I find that the best criteria for choosing the right one are: audience and price.

How to check if a Salesforce object has changed

When working with Apex triggers, it will sometimes be useful to know whether your
object has changed. You can write a function where you check every field by hard-coding them, but there is a more elegant way to accomplish this:


private static boolean hasChanged(YourObjectClass oldObject, YourObjectClass newObject) {

boolean changed = false;
Map fieldsMap = Schema.SObjectType.YourObjectClass.fields.getMap();
for (String key : fieldsMap.keySet()) {
Schema.DescribeFieldResult result = fieldsMap.get(key).getDescribe();

if (oldObject.get(result.getName()) != newObject.get(result.getName())) {
changed = true;
break;
}

}
return changed;
}

by Vladimir Martinov