function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kermit.thefrogkermit.thefrog 

visualforce page with conditional redirect to another visualforce page

Hello Community!

I have a custom object "Invoices__c" with a button to create a pdf document. This document is a visualforce page rendering as pdf. My issue is that based on a picklist value on my invoice-object I need to create an invoices with different layouts.

I read somewhere a solution for this, but I cannot find it anymore. The idea was to have a visualforce page with an "if-statement" that checks the picklist values and directs to another visualforce page which renders the pdf with the required layout.

Has anyone an idea how the if-statement on a visualforce page that directs to another one should look like?

Many thanks for your help!
Vishwajeet kumarVishwajeet kumar
Hello,
Creating VF page which can load a VF component could work. Different layouts can be defined in VF component based on picklist values.

Thanks.