+ Start a Discussion
Victor EcheverríaVictor Echeverría 

Task page layout depending on opportunity stage

I wan't to show different task page layouts for a single user depending on  the opportunity stage. Our sales process is automated through tasks needing different inputs during different stages in the process. I wan't to show only the required fields for each stage so there is less probability for the sales rep to get lost. What is the best method to do this?
Best Answer chosen by Victor Echeverría
Tarun Khatri (TK)Tarun Khatri (TK)
Hello Victor,

There are two approaches:
1. Configuration: Create separate records type and page layouts based on your Opportunity Stage. You can control the field visibility based on Record type and page layouts. User can chose the record type depending on Opportunity Stage value and create task record. 
In this case, you need to train user to chose the record type related to Opportunity Stage value. There are some chances of mistakes where user can chose wrong record type for a particular Opportunity Stage. 

2. Customization: Use Visualforce page for task creation and control field rendering of fields on VF page programmatically based on Opportunity Stage value. It will require some coding skills but will give you more control over record creation page.

Now, choice is yours... :)

-Thanks,
TK

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.

All Answers

Tarun Khatri (TK)Tarun Khatri (TK)
Hello Victor,

There are two approaches:
1. Configuration: Create separate records type and page layouts based on your Opportunity Stage. You can control the field visibility based on Record type and page layouts. User can chose the record type depending on Opportunity Stage value and create task record. 
In this case, you need to train user to chose the record type related to Opportunity Stage value. There are some chances of mistakes where user can chose wrong record type for a particular Opportunity Stage. 

2. Customization: Use Visualforce page for task creation and control field rendering of fields on VF page programmatically based on Opportunity Stage value. It will require some coding skills but will give you more control over record creation page.

Now, choice is yours... :)

-Thanks,
TK

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.
This was selected as the best answer
Victor EcheverríaVictor Echeverría
Thank you Tarun,

I think the approach I would need is customization as we are trying to eliminate human error as much as possible. I have some coding skills so this shouldn't too much trouble. Do you know any documentation I could use as a guide to get me started? Any help is really appreciated.

Thanks, 
Victor
Tarun Khatri (TK)Tarun Khatri (TK)
Hello Victor,

Refer below link. It is just an example how to render field in VF page dynamically. You might required custom controller or extension to build your business logic.You can pass set parameters which will handle the rendring part based on StageName field value. You can also refer Visualforce developer guide for more details.

https://help.salesforce.com/articleView?id=000003854&type=1


-Thanks,
TK