+ Start a Discussion
SAHG-SFDCSAHG-SFDC 

How to make column clickable?

I want the users to be able to  click on the value in the column and be redirected to the opportunity product record, Any suggestions please? 

<apex:column >
             <apex:outputLink value="https://XXXXXX.salesforce.com/?id={opportunity.OpportunityLineItems}">{!item.product2.name}</apex:outputLink>
            </apex:column> 
ra1ra1
Hi SAHG-SFDC

I believe, you might need to iterate over all OpportunityLineItems to make individual links. Below sample code may give you some clue.
 
<apex:repeat value="{!oppList}" var="opp">
                <apex:pageBlockSection collapsible="true" title="{!opp.Name}">
                    <apex:pageBlockTable value="{! opp.OpportunityLineItems}" var="oli">
                        <apex:column headerValue="View">
                            <apex:outputLink value="/{! oli.Id}" target="_blank" >View</apex:outputLink>
                        </apex:column>
                        <apex:column value="{! oli.Name}" headerValue="Name"/>
                    </apex:pageBlockTable>
            	</apex:pageBlockSection>
            </apex:repeat>


Hope this will help !!

Thanks,