Cross Object Formulas (wow!)

Following Steve’s lead, I tried my own cross-object formula using the Summer ’08 pre-release org I get to use as an AppExchange partner.

One of my (and probably your) pressing needs is the ability to display fields from related objects (e.g. show the Account Number on the Opportunity page). Before Summer ’08, you had to either use Workflow to copy a value over, embed an s-Control to pretend the field is actually on your object or tell users to use the hovers.

Cross Object formulas take care of this.  I decided to see how far it went. To start my test, I added a custom Lookup field from Accounts to Cases. I then created a Formula field on the Licenses custom object that I have in my org. My formula traversed the following relationship path:

  1. From License
  2. To Contact
  3. To Account
  4. To Case
  5. To Contact
  6. To Account – finally displaying the City from this Account

It worked! My resulting formula was:

sfLma__Contact__r.Account.Case__r.Contact.Account.BillingCity

I could’ve kept going through more relationships too.  The field selector that’s provided made this simple.  Just click click click and you’re done.

This fills a huge gap in the product.  This simple addition eliminates a big reason for having needed external reporting tools.  This handles the traversing “up” relationships (from detail to master), while the custom Report Types rolled out last release handled the traversing “down” relationships (from master to detail).  Combined, they solve a lot of reporting problems.

I can’t begin to tell you the headaches this bit of functionality will cure.

7 Comments

  1. ncurham Said,

    May 9, 2008 @ 1:20 am

    Yeahh. My idea did make it 🙂

    http://ideas.salesforce.com/article/show/10079268/CrossObject_Formula_Fields_Be_able_to_insert_related_Object_data_into_a_formula_field

    Love ur blog.

    Tkx for all!

  2. Matthew Scholtz Said,

    May 9, 2008 @ 6:05 pm

    Yeah, to me this is the biggest thing in the new release, other than VF.

    Matthew
    ONE/NW

  3. David S Said,

    May 18, 2008 @ 1:01 pm

    The release notes say that you have a limit of five relationships, but the language is VERY confusing. It’s possible that you maxed out with your five objects (and one field).

  4. Scott Hemmeter Said,

    May 19, 2008 @ 8:04 am

    @David S,

    Good catch. There does appear to be limitations. I just tested it and was able to go back in and create all the following:

    • sfLma__Contact__r.Account.Case__r.Contact.Account.BillingStreet
    • sfLma__Contact__r.Account.Case__r.Contact.Account.BillingCity
    • sfLma__Contact__r.Account.Case__r.Contact.Account.BillingState
    • sfLma__Contact__r.Account.Case__r.Contact.Account.BillingPostalCode
    • sfLma__Contact__r.Account.Case__r.Contact.Account.BillingCountry

    However, if I then went in and tried to create

    • sfLma__Lead__r.LastModifiedBy.Email

    it gave me an error that states:

    You have reached the maximum number of 5 object references on License
    You must remove at least 2 relationship(s) in order to save this formula
    Related objects referenced in this formula:

    * sfLma__Lead__r
    * sfLma__Lead__r.LastModifiedBy

    I did hit a limit.

  5. spence Said,

    August 10, 2008 @ 4:53 pm

    How did you get around the limit? Do you know of a way around the limit?

  6. Alex Said,

    October 29, 2008 @ 5:51 am

    I have the same problem and I am high interested in a solution..

    maybe S-Controls?

  7. Scott Hemmeter Said,

    October 29, 2008 @ 8:07 am

    @spence,

    The limit is a strict one. You can workaround it with s-Controls or, better yet, embedded VisualForce pages. However, those are only UI tricks. The cross-object formulas functionality is actually creating fields on your objects that you can report on, use in views, etc. s-Controls and VF will only be presenting some data to the users when looking at the screen.

    Therefore, choose your cross-object formula fields wisely.

RSS feed for comments on this post