You need to sign in to do that
Don't have an account?
help with APEX Class - Trying to pull opportunity Line Items on to a custom object
Custom Object is Account Executive Handoff - This is my Error
Error: Compile Error:
PricebookEntry.Name, TotalPrice, Quantity, On_Support__c from OpportunityLineItem
^
ERROR at Row:1:Column:71
No such column 'On_Support__c' on entity 'OpportunityLineItem'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names. at line 11 column 21
public class HandoffProducts
{
public List<OpportunityLineItem> lineItems { get; set; }
Public HandoffProducts( ApexPages.StandardController std )
{
if( std.getRecord().Id != null )
{
Account_Executive_Handoff__c con = [ Select Id, Opportunity__c from Account_Executive_Handoff__c where Id =: std.getRecord().Id ];
lineItems = [ Select Id, Opportunityid, PricebookEntry.Name, TotalPrice, Quantity, On_Support__c from OpportunityLineItem where Opportunityid =: con.Opportunity__c ];
}
else
{
lineItems = new List<OpportunityLineItem>();
}
}
public void save()
{
if( lineItems.size() > 0 )
update lineItems;
}
}
The Error says that you don't have On_Support__c field on OpportunityLineItem object. Can you check if the API name of the field is correct and if the field exists on the object.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
Below points will help to get resolve your issue:-
if you need any assistanse, Please let me know!!
Kindly mark my solution as the best answer if it helps you.
Thanks
Mukesh