You need to sign in to do that
Don't have an account?
Tommy Georgiou
Hide/unhide sections based on the Account type pick list
Hello,
On the account detail we have the account type based on : client, supplier and customer.
When it comes for the supplier we have a section called Supplier with custom fields enabled. The same goes for the rest of the types.
Our problem is that depending on the account type we would like these sections to hide/unhide.
Any suggestions will be helpful.
Thank you in advance.
On the account detail we have the account type based on : client, supplier and customer.
When it comes for the supplier we have a section called Supplier with custom fields enabled. The same goes for the rest of the types.
Our problem is that depending on the account type we would like these sections to hide/unhide.
Any suggestions will be helpful.
Thank you in advance.
perhaps you can use the account type as a recordtype-field. So, you are able to create different page layouts. And for every recordtype you can assign a different page layout.
Regards
Robert
(mindforce: mind-force.de)
All Answers
Here is the sample code, you can create a VF page and test this.
Best Regards,
Mithun.
perhaps you can use the account type as a recordtype-field. So, you are able to create different page layouts. And for every recordtype you can assign a different page layout.
Regards
Robert
(mindforce: mind-force.de)
Thank you again
When I try your sample code I get the error [Error] Error: Apex class 'cfs' does not exist
[Quick Fix] Create Apex class 'public with sharing class cfs'
[Quick Fix] Create Apex class 'public class cfs'
I am really new to SF development part so excuse me for my poor knowledge.
It seems to work OK when creating new accounts. The thing though is that I own nearly to 10k accounts with different types. I was thinking with exporting the record ID and import the accounts again that might work
Sorry It's my bad, Here is the updated code.
Best Regards,
Mithun.
Once you created the VF page change stage picklist values to Prospecting or Closed Won or Closed Lost, so that different sections will appear on your Page.
Best Regards,
Mithun.
I do not think that coding is really necessary here.
In my opinion the best practise for your problem is to use record types.
You can easiely define 3 record types for each account type and then customize the layouts for each record type to hide / unhide sections and fields. By doing so you avoid hard-coding and you have also the possibility to maintain different pickup values lists for each record type. Also you are able to apply changes on the layout in minutes without having to change any visualforce oder apex code.
think about it. If you need any futher help - please let me know.
Best Regards,
Robert
http://www.mind-force.de
you are right. For the existing accounts you should update the recordtype by upload. You can use e. g. dataloader.io for this to-do.
Regards
Robert
(Mindforce: https://www.mind-force.de)
Record types works perfect in this case.
Best Regards,
Mithun.