Visualforce Wizard: Contract Standard Object

In this example, I am using the Contract standard object and in this enterprise edition org we have the “Contract” standard object renamed as “Lease”. Therefore, as you review the code samples below, you have to use “Contract” and “Lease” interchangeably.

The business case here is to provide a visualforce wizard to help speed up data entry and also make the data entry more “bite size”. The Lease record, in this case, has near 80 fields to gather user input and spreading that data entry out over 5 steps in the wizard makes each step a little more manageable.

In total, there are:

  1. 5 visualforce pages
  2. 1 apex class
  3. 1 apex test class
  4. 1 static resource – a javascript file

Continue reading

Using Quotes in the Sales Cloud

Quick shout out to Salesforce.com and the new Quotes object released in Winter ’10.

We just now got around to enabling Quotes and it has been a breeze to set up. Plus, I’ve been able to create three different Quote templates with great ease. In sum, I’ve spent roughly a week setting it all up.

This now enables us to track and report on billable hours and revenue all in one place (Salesforce.com) that was previously being tracked in two systems: Salesforce.com and another, unnamed system.

Now, our Sales Management can see both low-frequency, high-value Opportunities in the same report as high-frequency, low-value Opportunities if they wish.

Kudos.

Using javascript and visualforce to solve a calculation problem

I had the need for a formula field in Salesforce.com to do two things:

  1. Evaluate an expression that my user types in. example: ((2+2) * 6) / 3
  2. Store the actual formula the user typed in to another field, in the case the formula should be audited for accuracy.

The formula is different for every record (being used on the Contract standard object), thus the need for my user to type it in. Plus, I have to be able include the actual formula in a Report column for auditors.

I solved this using a few things:

  1. Two custom fields:”FieldX__c” for the custom expression and “FieldY__c” for the evaluation
  2. Javacript to conduct the calculation
  3. A visualforce page to put the two fields and javascript together

Continue reading