Skip to main content

We want to use the same object called “Rental Listing” for another use. Basically we have rental properties and we also want to include vacation properties. 90% of the fields apply to this record, but we need a bit of a different page layout for the vacation property page. 

We want to show a different layout when a field = a specific value. 

Any suggestions?

I’ve tried to go into page assignments but that didn’t seem to work. 

I do not want to just do field rendering either as a new layout and UX would be more appropriate. 

Suggestions?

Two ways to go about this. 

1. Make each kind of property a record type in the standard salesforce setup.   Then have page assignments take the user to a different skuid page for each record type.  (see this tutorial

2. Make one page,  but add conditional rendering to adjust the layout appropriately for each scenario. 



Got it! Makes sense. Thanks


Going the RecordType route definitely works and makes the most use of standard Skuid/Salesforce functionality, but Record Types have other uses of course, and you may not want to mess with them (or have to change anything about your data anyway). Just in case this turns out to be true, here’s a third option.


It requires a little bit of Visualforce (and maybe Apex depending on how complicated the redirect logic is), but you could make use of the “Other Situation” Page Assignments here too. Create a Page Assignment for each “situation” you want to handle giving each an appropriate value in for Other Situation. Create a Visualforce page which uses the skuid:page component to selectively render the correct Page Assignment. For instance, say you want to show one Edit page for Accounts in the Education industry and another one for every other industry. You could use something like…


<apex:page standardController="Account" readOnly="true"> <!-- Handle situation 1 --> <apex:outputPanel rendered="{!Account.Industry == 'Education'}"> <skuid:page objectType="<strong>EducationAccounts" </strong>actionType="Edit"/> </apex:outputPanel> <!-- Handle situation 2 --> <apex:outputPanel rendered="{!Account.Industry != 'Education'}"> <skuid:page objectType="<strong>NonEducationAccounts" </strong>actionType="Edit"/> </apex:outputPanel> </apex:page> 

Check out this tutorial for the official writeup.