You need to sign in to do that
Don't have an account?
Baguiar2
Getparameters from current page not working
HI guys,
very simple class but it is not capturing the Opportunity__C (which is a master detail field to the Opportunity) id, to macth the Opportunity Line Items I want. I have the exact same class for another object and it captures the object Id just fine. Not sure whats the issue here..
public class productsprojects { private List<OpportunityLineItem> products; public List<OpportunityLineItem> getproducts() { products = [ SELECT product_name__c, Design__c, Development__c, Custom_Template_Category__c FROM OpportunityLineItem WHERE OpportunityId = :System.currentPagereference().getParameters().get('Opportunity__c') ]; return products; } }
Thanks for the help!
B
Found the issue...
I ahev to query frst the Opportunity__C value as the custom field value can't be passed from the loaded page. here is the solution:
All Answers
Try,
Thanks,
Devendra
Nops.. didn't work. If I enter the ID value itself, it works, so I'm sure the SOQL is fine. Just not getting the parameter from the page...
What is the name of variable that you are passing as a Id to visualforce page?
Thanks,
Devendra
It is not from a visualforce page actualy. I have a custom object built that has a field called Opportunity__C, which is a master-detail to the Opportunity. So, this class is pulling all the Opportunitylineitems from te same opportnity that is on the loaded page for the custom object.
So, I'm really just trying to get the Opportunity ID (which is the field Opportunity__C) from the current custom object , and pass it to the SOQL on the class.
Does that make sense. ?
Found the issue...
I ahev to query frst the Opportunity__C value as the custom field value can't be passed from the loaded page. here is the solution:
Great.!!
Cheers,
Devendra