You need to sign in to do that
Don't have an account?
Daniel Khan 21
Get Name of Opportunity Line Item without Opportunity Name
Hi all,
I've done some APEX based on an idea of Deepak Anand (https://success.salesforce.com/answers?id=90630000000hTXHAA2).
Actually everything works, but on the generated .pdf the name of the Opportunity is shown in the line of the product name.
I only want to have the name of the product. What am I missing? THANKS FOR ANY ADVICE!
My APEX Class:
public class OpptyGenPDFExtension { public List<OpportunityLineItem > OLI {get; set;} public OpptyGenPDFExtension(ApexPages.StandardController controller) { String oliIDs = ApexPages.currentPage().getParameters().get('oliid'); if(!String.isBlank(oliIDs)){ Set<Id> oliIdSet = new Set<Id>(); for(String oliId : oliIDs.split(',')){ oliIdSet.add(oliId); } OLI = [ SELECT Name,ProductCode,Quantity FROM OpportunityLineItem WHERE Id IN :oliIdSet ]; } } }
My VF:
<apex:page standardController="Opportunity" extensions="OpptyGenPDFExtension" renderAs="pdf"> <table width="100%" style="font-family: Arial, Helvetica, sans-serif; border-collapse: collapse;" cellpadding="5"> <tr> <td colspan="4"> Hardware Anforderungen für neues System </td> <td> Printed on: {!DAY(TODAY())}.{!MONTH(TODAY())}.{!YEAR(TODAY())} </td> </tr> <tr> <td colspan="4" style="font-size: x-large; font-weight: bold"> Opportunity Name: {!Opportunity.Name} </td> </tr> <tr> <td align="left" style="color: #808080; "> </td> <td style="font-weight: bold"> </td> <td align="left" style="color: #808080; "> </td> <td style="font-weight: bold"> </td> </tr> <tr> <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #ddb929;"> Opportunity Number </td> <td style="font-weight: bold"> {!Opportunity.Opportunity_Nummer__c} </td> </tr> <tr> <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #ddb929;"> Hardware configured by </td> <td style="font-weight: bold"> {!Opportunity.System_konfiguriert_von__c} </td> </tr> <tr> <td align="left" style="color: #808080; border-right-style: solid; border-right-width: thin; border-right-color: #ddb929;"> Account Name </td> <td style="font-weight: bold"> {!Opportunity.Account.Name} </td> </tr> <tr> <td colspan="4"> </td> </tr> <tr> </tr> <tr> <td style="font-weight: bold"> </td> <td align="right" style="color: #808080; "> </td> <td style="font-weight: bold"> </td> </tr> <tr> <td align="right" style="color: #808080; "> </td> <td style="font-weight: bold"> </td> <td align="right" style="color: #808080; "> </td> <td style="font-weight: bold"> </td> </tr> </table> <br/><br/> <apex:outputPanel rendered="{!OLI != NULL}"> <table width="100%" style="font-family: Arial, Helvetica, sans-serif; border-collapse: collapse;" cellpadding="5"> <tr> <td colspan="6" style="font-weight: bold; border-bottom-style: solid; border-bottom-width: thick; border-bottom-color: #ddb929;"> Line Item </td> </tr> <tr> <td style="font-weight: bold; background-color: #FFFFCC;"> Product Name </td> <td style="font-weight: bold; background-color: #FFFFCC;"> Product Code </td> <td style="font-weight: bold; background-color: #FFFFCC;"> Quantity </td> </tr> <apex:repeat value="{!OLI}" var="opl"> <tr id="{!opl.Id}"> <td> {!opl.Name} </td> <td> {!opl.ProductCode} </td> <td> {!opl.Quantity} </td> </tr> </apex:repeat> </table> </apex:outputPanel> </apex:page>
Daniel Khan 21
I think it depends on line 128 of the VF code. But dunno the right path to solve problem.