Filtered by 2011

9 Results

Salesforce Unit Test Tip for Checking Trigger Status

Anyone with a lot of Apex code in their production Salesforce org knows that the more code you have the more tedious deploying new code to that org becomes. One of the orgs I work in has some triggers that get turned off and on for reasons that only the business owners understand. As any developer understands turning off a trigger is much easier than an Apex class, which is where we often encounter deployment issues. [...]

Clone Salesforce Records Using a Custom Button Or Link

Almost four years ago I wrote the first post for this blog. That post had to do with passing field values in a URL in order to populate those values on an edit page. What's interesting is that the original post still gets a ton of traffic. So I'd like to expand on that topic again in this post and illustrate how you can build on that original logic in order to do something useful. In this case, I want to create a custom button that will clone a User record and remove certain fields so that I don't have to fill out so much information when I create new Users. [...]

Salesforce Apex Code for DateTime Duration

I've been developing a lot of batch Apex routines lately. The nature of batch Apex is that it can run whenever resources are available and process many records while being more flexible with platform governor limits. So I might schedule a job to run and it could take anywhere from a few minutes to many hours. Many variables impact the run time of a batch routine. Things like the number of records being processed or platform resource availability. [...]

Apex Code Sample Illustrating How to Drop Leading Zeros

Here is an example regarding the use of the pattern and matcher methods in an Apex class. For this particular code sample I am using the methods to check a passed text string for the occurrence of leading zeros in the string and removing them when they exist. The code I have written here was actually used on a project where I had to validate that User records contained a valid EmployeeNumber value. And, as you probably know, this particular field is editable by users and is stored as text in the database. Rather than go through the trouble of creating another Number type field on the User object I thought it would be easier and less disruptive to simply check the value when I needed to reference it in any Apex logic. [...]

Apex Unit Test: SOQL Filter

Today I participated in an online meeting, which discussed some of the "best practices" for testing Apex code, Visualforce pages, etc. One of the topics that was pretty much skipped but came up during the Q&A portion of the meeting was regarding how to ensure that the test code you write refrains from grabbing any actual live production data and only grabs the records created to facilitate the test. They discussed one way to do this but I have another and I thought it could be useful to other developers. [...]

Yahoo! Modal Dialogs in Visualforce

I found this great post/tutorial (Modal Dialogs in Visualforce using the Yahoo! User Interface Library) regarding the use of the Yahoo! User Interface (YUI) Library within Visualforce pages. But what if you work for a business that uses Internet Explorer (IE) as the standard / supported browser across the enterprise? You get the security warnings dialog when accessing the Visualforce page, of course. [...]

Dynamic Salesforce Report from Custom Button

I recently attended the Buffalo Salesforce User Group meeting. During the session a guest speaker conducted a demo of some development he did for his company's production Salesforce org. One of the items he touched on that spurred a lot of discussion was a custom button he built to pass a value to a report from a detail page of a given record. The resulting discussion was surprising because I really didn't know that so many admins were unaware of the benefits of creating these custom buttons. And, after participating in the discussion, I thought that this would be a great topic for a blog post because there is so much that you can do if you understand this relatively simple trick. [...]

Visualforce Component for Locale Based DateTime Display

Sometimes, I really dislike Visualforce... Last week I spent a ton of time troubleshooting a display issue for a page that was built by another developer. The issue was that the DateTime field for an object was not displaying properly. It was showing the value in GMT and not the timezone of the user. After spending way too much time reviewing everything I decided to build a custom Visualforce component to eliminate the problem altogether. [...]

sObject Describe Result for Visualforce Picklist

More than a while ago, I wrote about populating query results to a picklist for use in a Visualforce page. That post receives a lot of traffic and I get some additional emails regarding that topic. So I thought I would put together another post similar to that one but with a bit of a twist. In the sample I will cover in this post I am going to show you how to use the methods for the Describe Result sObject in order to create picklists within Visualforce pages. [...]

Automated Exchange Rates in

Reduce Repetitive Tasks, Eliminate Errors & Free Up Your Administrators.

Birthday Reminders for

It might lead to a sale. Or it might make you feel good.