Posts

Showing posts from January, 2015

Dynamic Visualforce Components

Visualforce is primarily intended to be a static, markup-driven language that lets developers create a user interface that matches the Salesforce look-and-feel. However, there are occasions when it is necessary to programmatically create a page. Usually, this is to achieve complicated user interface behavior that is difficult or impossible with standard markup. Dynamic Visualforce components offer a way to create Visualforce pages that vary the content or arrangement of the component tree according to a variety of states, such as a user’s permissions or actions, user or organization preferences, the data being displayed, and so on. Rather than using standard markup, dynamic Visualforce components are designed in Apex. A dynamic Visualforce component is defined in Apex like this: Component.Component_namespace.Component_name For example, <apex:dataTable> becomes Component.Apex.DataTable. The Standard Component Reference contains the dynamic representation for all valid Visualforce ...

EXECUTING ANONYMOUS APEX INSIDE ECLIPSE

Image
One of the most underutilized programming techniques in Force.com is the ability to execute a snippet of apex code "anonymously". I know, it has a funny ring to it. Anonymous code is basically just a block of code that doesn't get stored inside Salesforce.com. This is nice, because often times you just want to try part of a method out or execute a SOQL statement without going through the hassle of adding it to a trigger or a class. This is a great technique to quickly evaluate or debug a statement of code on-the-fly. There are a couple of ways you can do this. Open up the Developer Console inside Salesforce The executeAnonymousWeb services API call Inside Eclipse/Force.com IDE I typically do this inside Eclipse so I thought I would quickly highlight how to do that and include a screenshot as a guide. When you have the Force.com IDE plugin installed in Eclipse, all you have to do is navigate to the Execute Anonymous tab. If you don't see the tab, make sure you've g...

Advanced Formula Fields in Salesforce

Use the following formula samples when creating custom formula fields. For samples of other types of formulas, see Examples of Validation Rules and Useful Default Field Value Formulas. This document contains the following categories of custom formula samples: Account Management Account Rating This formula evaluates Annual Revenue, Billing Country, and Type, and assigns a value of “Hot,” “Warm,” or “Cold.” IF (AND (AnnualRevenue > 10000000, CONTAINS (CASE (BillingCountry, "United States", "US", "America", "US", "USA", "US", "NA"), "US")), IF(ISPICKVAL(Type, "Manufacturing Partner"), "Hot", IF(OR (ISPICKVAL (Type, "Channel Partner/Reseller"), ISPICKVAL(Type, "Installation Partner")), "Warm", "Cold")), "Cold") For details about using these functions, see IF, AND, CONTAINS, CASE, and ISPICKVAL. In addition, you can reference this Account ...

story 56: In the Footsteps of a Killer

From 1976 to 1986, one of the most violent serial criminals in American history terrorized communities throughout California. He was little known, never caught, and might still be out there. The author, along with several others, can’t stop working on the case. Michelle McNamara | Los Angeles | Feb 2013 -- MISSING LINKS On a sleepless night last July—one of dozens I’ve powered through during the months I’ve spent tracking him down—I Googled a description of a pair of cuff links he stole in the midst of a home invasion in Stockton in September 1977. At that time the Golden State Killer, as I’ve recently come to call him, hadn’t yet graduated to murder. He was a serial rapist who was attacking women in their bedrooms from Sacramento to San Ramon, targeting those who lived in quiet upper-middle-class suburban neighborhoods. He was young—anywhere from 18 to 30—Caucasian, and athletic, capable of eluding capture by jumping roofs and vaulting tall fences. He frequently wore a ski mask. He ha...