You need to sign in to do that
Don't have an account?
Oliver Freeman 9
Visualforce Page for Cases for Same Asset
Hello,
I'm trying to create a VF page which will appear on the Case page layout displaying all other cases for the asset on that particular case - here's what I have done so far:
- Created custom formula field on the Case Object for the AssetId (Asset_ID__c)
- Created an Apex Class:
Currently, all that this is showing is the current case, not all cases for that asset.
Sorry if I'm just being an idiot, I'm very new to Apex Classes and Visualforce!
Thanks,
Oli
I'm trying to create a VF page which will appear on the Case page layout displaying all other cases for the asset on that particular case - here's what I have done so far:
- Created custom formula field on the Case Object for the AssetId (Asset_ID__c)
- Created an Apex Class:
public class CaseRelatedCasesExtension { public CaseRelatedCasesExtension(ApexPages.StandardController controller) { } public list<Case> cases {get;set;} public CaseRelatedCasesExtension(){ cases = [select id, assetid, accountid, CaseNumber, OwnerId from case Where Asset.Id='AssetId']; } }- Created a Visualforce Page:
<apex:page standardController="Case" extensions="CaseRelatedCasesExtension"> <apex:form > <apex:pageBlock > Case Related Emails <apex:PageBlockTable value="{!case}" var="case"> <apex:column width="10%"> <apex:commandLink value="View" onclick="window.open('/{!case.Id}');"/> </apex:column> <apex:column width="80%" value="{!case.Subject}" /> <apex:column width="10%" value="{!case.CaseNumber}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>
Currently, all that this is showing is the current case, not all cases for that asset.
Sorry if I'm just being an idiot, I'm very new to Apex Classes and Visualforce!
Thanks,
Oli
Very helpful! Resolved the issues I was experiencing.
All Answers
Very helpful! Resolved the issues I was experiencing.