You need to sign in to do that
Don't have an account?
JHoskins
Visualforce & Native Page Layouts - Together?
I'm in desperate need of development advice as it relates to
Visualforce before the Holiday and I was wondering if you could point
me in the right direction.
Any advice, code examples or links to references would be greatly appreciated.
I need to know if its possible to use Visualforce & Native Page Layouts together within One Object (Case) with a single Record Type.
Scenario:
We have one Record Type "Accounting" for Cases with multiple case reasons, "Check Image Request", "Inbound Repricing" & "Provider Login Request"
We need a way to use Visualforce for specific Case Reasons.
So Case Reason "Check Image Request" uses the native Case Page Layout but Case Reason "Provider Login Request" uses a Visualforce Page.
I've tried overriding the "View" Action under Button & Links to a Visualforce Page with an extended Controller that overwrites the view() method. But for some reason It's not executing my code.
My example above is trying to return a specific reference based on case reason.
/{!case.id} for native page layout or /apex/vfPage?id={!case.if} for a Visualforce Page designed for a specific case type.
I noticed if I override "View" with a Visualforce Page all links like /{!case.id} automatically redirect to /vforcePage?id={!case.id}
So I'm not sure If I should use Override under buttons & link.
The Page Layout for Case Reason "Provider Login Request" is below:
Notice I'm only rendering the form if Case Reason Matches "Provider Login Request"
The Ultimate Question: Would it be wise to just use do conditional displays for all Case Reasons?
I'm
thinking as an absolute last resort I could a use Java Script to
redirect on page load but there has to be something I can to with Apex
Code.
I know its Christmas Eve but I don't know where else to turn.
Thanks & Happy Holidays
Any advice, code examples or links to references would be greatly appreciated.
I need to know if its possible to use Visualforce & Native Page Layouts together within One Object (Case) with a single Record Type.
Scenario:
We have one Record Type "Accounting" for Cases with multiple case reasons, "Check Image Request", "Inbound Repricing" & "Provider Login Request"
We need a way to use Visualforce for specific Case Reasons.
So Case Reason "Check Image Request" uses the native Case Page Layout but Case Reason "Provider Login Request" uses a Visualforce Page.
I've tried overriding the "View" Action under Button & Links to a Visualforce Page with an extended Controller that overwrites the view() method. But for some reason It's not executing my code.
Code:
public class caseExtendedController { private final Case c; public caseExtendedController( ApexPages.StandardController stdController) { this.c = (Case)stdController.getRecord(); } public PageReference view() { if(c.reason == 'Provider Login Request'){ System.debug('Hi'); return new PageReference('http://www.google.com'); }else{ return new ApexPages.StandardController(c).view(); } } }
/{!case.id} for native page layout or /apex/vfPage?id={!case.if} for a Visualforce Page designed for a specific case type.
I noticed if I override "View" with a Visualforce Page all links like /{!case.id} automatically redirect to /vforcePage?id={!case.id}
So I'm not sure If I should use Override under buttons & link.
The Page Layout for Case Reason "Provider Login Request" is below:
Notice I'm only rendering the form if Case Reason Matches "Provider Login Request"
The Ultimate Question: Would it be wise to just use do conditional displays for all Case Reasons?
Code:
<apex:page standardController="Case" extensions="caseExtendedController"> <!-- Define Tab panel .css styles --> <style> .activeTab {background-color: #236FBD; color:white; background-image:none} .inactiveTab { background-color: lightgrey; color:black; background-image:none} </style> <!-- Create Tab panel --> <apex:form rendered="{!if(case.reason='Provider Login Request','true','false')}"> <apex:pageBlock title="Case # {!case.CaseNumber} - {!case.Reason} ({!case.Match_Result__c})" mode="edit"> <apex:pageBlockButtons location="top"> <apex:commandButton action="{!Save}" value="Save"/> <apex:commandButton action="{CloseCase}" value="Close Case"/> </apex:pageBlockButtons> <apex:pageBlockSection columns="2" title="Information from Webform to work this Case"> <apex:outputField value="{!case.SuppliedFirstName__c}"/> <apex:outputField value="{!case.Organization_Type__c}"/> <apex:outputField value="{!case.SuppliedLastName__c}"/> <apex:outputField value="{!case.SuppliedCompany}"/> <apex:outputField value="{!case.SuppliedEmail}"/> <apex:outputField value="{!case.SuppliedPhone}"/> <apex:outputField value="{!case.Match_Result__c}"/> </apex:pageBlockSection> <apex:pageBlockSection columns="2" title="Please MATCH the credentials to a current Provider Account"> <apex:inputField value="{!case.FEIN__c}"/> <apex:inputField value="{!case.NPI__c}"/> <apex:inputField value="{!case.NABP__c}" rendered="{!CONTAINS('Pharmacy',case.Organization_Type__c)}"/> <apex:inputField value="{!case.DEA__c}" rendered="{!CONTAINS('Physician',case.Organization_Type__c)}"/> <apex:inputField value="{!case.DPR__c}" rendered="{!CONTAINS('Physician',case.Organization_Type__c)}"/> </apex:pageBlockSection> <apex:pageBlockSection columns="2" title="Requested User Login Information"> <apex:inputField value="{!case.SuppliedUsername__c}"/> <apex:inputField value="{!case.accountId}"/> <apex:inputField value="{!case.SuppliedPassword__c}"/> <apex:outputField value="{!case.contactId}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>
I know its Christmas Eve but I don't know where else to turn.
Thanks & Happy Holidays
There are a number of related threads in this forum - if you search on Conditional Routing you'll find a few that should be helpful, e.g. this one
Message Edited by dchasman on 12-29-2008 09:55 AM