You need to sign in to do that
Don't have an account?
Joanne Butterfield
Inline Visualforce Page with Standard Case Page Layouts
Hi All,
I'm trying to create an Inline Visualforce Page on my standard case page layout.
I'm not very familiar with VF. I have a button in an opportunity which creates a case related to the opportunity. I would like to view the opportunity products in the case.
I'm needing some assistant with the VF page, I tried the below however wasn’t successful. Any help would be much appreciated.
Thank you in advance!
<apex:page standardController="Case" >
<apex:relatedList ="OpportunityLineItems"/>
</apex:page>
I'm trying to create an Inline Visualforce Page on my standard case page layout.
I'm not very familiar with VF. I have a button in an opportunity which creates a case related to the opportunity. I would like to view the opportunity products in the case.
I'm needing some assistant with the VF page, I tried the below however wasn’t successful. Any help would be much appreciated.
Thank you in advance!
<apex:page standardController="Case" >
<apex:relatedList ="OpportunityLineItems"/>
</apex:page>
In this case your controller will need to look something like this:
The opportunity and case are linked by a look up field to the opportunity - "Related Opportunity"
Is the opportunity contact and case contact are diffrent will this still work?
Sorry I'm new with apex code and alittle lost.
Thank you again for your help!
I'm getting the following error
Error Error: Compile Error: Invalid constructor name: CrossObjectContactInfo at line 10 column 8
Public With Sharing Class crossObjectOpportunityInfo {
Public Opportunity o {get; private set;}
Public Case c {get; private set;}
Public List<Schema.FieldSetMember> getFields() {
return SObjectType.OpportunityLineitems.FieldSets.Display_On_Case.getFields();
}
Public crossObjectContactInfo(ApexPages.StandardController sc) {
this.o = [SELECT Id, AccountId FROM Opportunity WHERE RELATED_OPPORTUNITY__C = :sc.getId() LIMIT 1];
String queryString = 'SELECT Id';
List<Schema.FieldSetMember> querySet = SObjectType.OpportunityLineItem.FieldSets.Display_On_Case.getFields();
for(Schema.FieldSetMember f : querySet) {
queryString += ', '+ f.getFieldPath();
}
if(o.Npe01__Contact_Id_for_Role__c == null) {
Id cid = [SELECT Id FROM Contact WHERE AccountId = :o.AccountId LIMIT 1].Id;
queryString += ' FROM Opportunity WHERE id = \''+ cid +'\' LIMIT 1';
}
this.contact = database.Query(queryString);
}
}