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
adish2507adish2507 

SFDC - Apex Error

Hi

 

Am getting the following error while creating APEX Trigger

 

Error: Compile Error: sObject type 'Line_Item__c' is not supported. If you are attempting to use a custom object, be sure to append the '__c' after the entity name. Please reference your WSDL or the describe call for the appropriate names. at line 3 column 1

Apex Trigger Subject :

 

trigger HandleProductPriceChange on Merchandise__c (after update) {

List<Line_Item__c> openLineItems =

[SELECT j.Unit_Price__c, j.Merchandise__r.Price__c

FROM Line_Item__c j

WHERE j.Invoice_Statement__r.Status__c = 'Negotiating'

AND j.Merchandise__r.id IN :Trigger.new

FOR UPDATE];

for (Line_Item__c li: openLineItems) {

if ( li.Merchandise__r.Price__c < li.Unit_Price__c ){

li.Unit_Price__c = li.Merchandise__r.Price__c;

}

}

update openLineItems;

}

 

regards

 

Jerome John

 

Best Answer chosen by Admin (Salesforce Developers) 
SeAlVa_VFTabulatorSeAlVa_VFTabulator

Are you sure that you have an Object with 'Line_Item__c' as API Name?

 

Check it out.

All Answers

SeAlVa_VFTabulatorSeAlVa_VFTabulator

Are you sure that you have an Object with 'Line_Item__c' as API Name?

 

Check it out.

This was selected as the best answer
adish2507adish2507

Yes ..am sure the line item is Line_Items_c

 

Please guide to resolve the querry ...am not able to save ..for trigger testing

 

regards

 

Jerome John

kiranmutturukiranmutturu

here u are saying it is Line_Items_c but in the code it is Line_Item_c.. with out S.. check it out the API name 

adish2507adish2507

Hi All

 

The error ..got resolved ....the error was in Line_Item_c ..the exact line Item was Line_Items_c

 

Thank you

 

regards

 

Jerome John