function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Toni  MillerToni Miller 

getting error message Urgently needed help

I am trying to add products to opplineitem. Once the UI clicks save after adding the price I want the product to get to the opportunity that it was on when started. Here is the code but giving me an error. Error: Syntax error. Found 'Select'

Select Id, Name, <br>(Select Id, Quantity, TotalPrice, <br>PricebookEntry.Product2.ProductCode, <br>PricebookEntry.Product2.Name <br>From OpportunityLineItems) <br>From Opportunity Where Id = '{!Opportunity.Id}'

Ant help will be appreciated
Amit Singh 1Amit Singh 1
Hi Toni,

Where are you executing this SOQL query in Apes Class?

Try below query
Select Id, Name, (Select Id, Quantity, TotalPrice, PricebookEntry.Product2.ProductCode, PricebookEntry.Product2.Name From OpportunityLineItems) From Opportunity Where Id = 'Your Opportunity Id'
Hope this will help :)

Thanks,
Amit Singh