You need to sign in to do that
Don't have an account?
KCarmen
How can I write a formula field to update fields based on a Picklist choice?
Hi all -
I have a Customer Object called PM Picks that is a Master-Detail relationship with the account. On the PM Picks, I have a picklist field that has our Product Lines. I also have other fields on the PM Pick pulling from the account such as #open opps, open opp amount, install base, etc. When someone chooses a product line, I would like the information for only the product chosen from the picklist to show up on the PM Pick record created. Basically, filtering the Account information based on product line. What is the best way to do this?
I have a Customer Object called PM Picks that is a Master-Detail relationship with the account. On the PM Picks, I have a picklist field that has our Product Lines. I also have other fields on the PM Pick pulling from the account such as #open opps, open opp amount, install base, etc. When someone chooses a product line, I would like the information for only the product chosen from the picklist to show up on the PM Pick record created. Basically, filtering the Account information based on product line. What is the best way to do this?
All Answers
If this is the case you pretty much have two options.
Record Types
This is the "easiest" option because the platform supports it the best and does not require any real development. (You may have to do a little URL hacking if you want to make creation a little eaiser). To do this you would esentially change your Product Lines to be a Record Type on the PM Picks object. Then you can create Layouts based on the Record Type and choose which fields you want to show / hide based on the Record Type
Pros
- Very little development work
- Can be done directly in production
- Natively supported on the platform
ConsVisualforce
This is the more complicated method, but will not require a change to your data structure. For this you create a Visualforce page that overrides your new / edit page. The Visualforce page includes inputFields for all of your fields on the object. You then add a rendered flag to it to determine if it should be show for the picklist value. The tricky bit here is maintaining the field list to picklist mapping in your controller as well as rerendering the entire page if the picklist is changed.
Pros
- No changes to data model
- Easier to customize / stylize
ConsIf I'm way off base on what you're trying to do, let me know and I'll try again.
Record Types may not be a good solution for us because we have so many product lines but even if I decide to create Record Types for each product line, how can I get the formula fields within that record type to only populate on what that record type is for? I'm thinking I have to create a seperate roll-up for each Product line and insert into the appropriate Record Type.