You need to sign in to do that
Don't have an account?
csathishbabu
How to get RelatedList Values in Opportunity Tab to Visual Force Page
Hi I have created a visual Force page for Create a invoice for the Products added in The Relatedlist of opportunity Tab,
as im new to apex COntroller,I want to know how to retrive the products in the related list of opportunity tab to a visualforce page Suggest me an idea to achieve it ur help will be of great help Thanks.
Which controller your using? Standard controller or custom controller?
Custom Controller
you can make query:
OpportunityLineItem[] products = [Select o.Quantity, o.UnitPrice,o.ListPrice,o.Id,o.OpportunityId,o.Description,o.Description__c, o.Opportunity.Description, o.Opportunity.Id, o.Opportunity.Name, o.Opportunity.StageName,o.PricebookEntry.Id,o.PricebookEntryId, o.PricebookEntry.Name,o.PricebookEntry.Product2Id from OpportunityLineItem o where o.OpportunityId =: opportunityId ];
OpportuniyId should be a variable containing valid opportunity id.
Thanks Dude, i got the product list in visualpage but now i want to calculate the total amount of all the products listed in visualpage so how to loop the products and sum in controller
FIrst Add o.Quantity in SOQL
Looping
OppTotal will give you product total
Thanks,
Bala