You need to sign in to do that
Don't have an account?
Yukinon
Fetch record Id in url not working
Hello any idea why it's not fetching the record id even though I'm using
ApexPages.CurrentPage().getparameters().get('id');
I'm not getting any record.
Controller:
Component:
Thanks!
ApexPages.CurrentPage().getparameters().get('id');
I'm not getting any record.
Controller:
public class ActiveOpportunityLineItems { private final List<OpportunityLineItem> lineItems; public String oppId {get;set;} public ActiveOpportunityLineItems(){ oppId = ApexPages.CurrentPage().getparameters().get('id'); lineItems = [SELECT ProductCode,UnitPrice,Description,Status__c From OpportunityLineItem WHERE Status__c = 'ACTIVE' AND OpportunityId = :oppId]; } public List<OpportunityLineItem> getActiveOpportunityLineItems(){ return lineItems; } }
Component:
<apex:component controller="ActiveOpportunityLineItems" access="global"> <apex:dataTable border="below" value="{!ActiveOpportunityLineItems}" var="active_opp" width="75%" style="text-align:center;" > <apex:column value="{!active_opp.ProductCode}" headerValue="Product Code" /> <apex:column value="{!active_opp.Description}" headerValue="Line Description"/> <apex:column value="{!active_opp.UnitPrice}" headerValue="Sales Price"/> <apex:column value="{!active_opp.Status__c}" headerValue="Status"/> </apex:dataTable> </apex:component>
Thanks!
It should be work, First you need to add below code for debug
After that we will make sure what is exact issue
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh