I'm working on a concept for asset management in Salesforce. The idea is

  • Cars (type)
    • Manufacturer (Audi, BMW, VW - Will most likely be an external lookup to CAP data)
      • Model (A6)
        • Derivative (1.8 TFSI SE Executive 4dr S Tronic) (THE ASSET)
  • Phones (type)
    • Manufacturer (Apple, Samsung, Google)
      • Model (iPhone, Galaxy, Pixel)
        • Device (6s, s7, 2 XL) (THE ASSET)
          • Assign SIM to contact (attribute)
          • IMEI Number (attribute)
          • Telephone Number (attribute)
  • Monitor (type)
    • Manufacturer (AOC, ASUS)
      • Model (THE ASSET)
        • Screen size (attribute)
        • Assign to contact (attribute)
        • Condition (attribute)

So the idea is there will be one Asset list with different filters to view each by their Type (Car, Phone, Monitor). However, adding the Asset is proving a challenge as each would have different attributes that are applicable and I want to refrain from keeping it as simple as

  • Type
  • Manufacturer (Audi, Apple, ASUS)
  • Make (A6, iPhone, EJ-20014)
  • Model (Coupe, 6, Whatever here)

Is there a way to display a different set of attributes for the user to input into the Assets table dependent on the "type"?

Forgive me if this logic isn't actually possible in Salesforce and I need to approach this differently but any help / direction is much appreciated!

  • Record Types sound like what you need.
    – David Reed
    Jun 19 '18 at 12:48
  • @DavidReed You're right, thank you for giving a link to a lesson and pushing me in the right direction David! Jun 19 '18 at 13:30
  • I will flesh out into an answer. Glad that helps.
    – David Reed
    Jun 19 '18 at 13:32

Record Types on an object allow you to surface different page layouts for different types, meaning that you can display completely different attributes. Additionally, you can filter available picklist values by record type within fields that are shared across record types.

In your situation, you could create record types for Car, Phone, and Monitor. You could define a "core" set of attributes that would apply to all record types (such as "Manufacturer"), and show those on all of your page layouts. You could, however, ensure that the Manufacturer "Audi" is only available for the record type "Car".

Then, you can add fields that are specific to each record type, such as Car Model Year and Monitor Screen Size. You can place these fields on the page layouts for the record types to which they apply, and leave them hidden for other record types.

However, be aware of a few important caveats:

  • There is an overall limit to the number of fields you can create on an object. If you begin to approach this limit or envision approaching this limit, and have a large number of fields that are specific to one and only one record type, you may be in a situation that calls for separate custom objects.
  • All fields are available on the object through the API and reporting, regardless of the record type. It may be useful to include the record type in the field name ("Car Model") to make reporting less confusing.
  • Remember that instances of the Monitor record type are still going to have a Car Model, for example, field, but it'll be empty and won't be shown on the page layout.

For more intro, see Trailhead on record types.

  • Just a thought... How about creating field sets for different types... And have a vf page or ltgn component to render those field sets depending upon the type(car, mobile, etc). Jun 19 '18 at 13:56
  • I understand this more now! Explaining the possibilities with my use case are worth their weight in gold! Knowing the logic Salesforce need you to follow seems to be more important than actually putting the task into practice. It's a huge leap from the open world of PHP where there are several ways to walk over a road. Jun 19 '18 at 13:57
  • @pranavprashant what would that add over standard page layout assignments?
    – David Reed
    Jun 19 '18 at 13:57
  • @David... If u switch to lightning, standard page layouts based on record type is not possible. Jun 19 '18 at 14:02
  • @pranavprashant I may not be understanding you correctly. The Lightning record page's Details pane does show the correct layout assigned based on record type.
    – David Reed
    Jun 19 '18 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.