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
beginner apexbeginner apex 

it got error in apex mode

hi im beginner , can u solve this problem , let you know reply through mail , anyone tell me  im learning thisfoce , can u anyone what  is the procedure for beginner 

 

Error: Compile Error: sObject type '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 26

 

codins is -

trigger handledseatpriceChange on seat__c (after update) {
//update invoice items associated with open invoices
List<Item_c> openItems =[SELECT j.seat_price , j.seat_r.price_c FROM Item_c j
WHERE j.invoicestatemnt_r.Status_c = 'notavailable' AND j.seat_r.id IN :
Trigger.new FOR UPDATE ];
}

Rajesh SriramuluRajesh Sriramulu

Hi,

 

Check the list as u mentioned 'Item__c'. Check the correct API name of that object and save it.

 

 

Regards,

Rajesh.

Sunny670Sunny670
Item_c should be replaced by Item__c and also you may get error at
j.invoicestatemnt_r.Status_c. make sure you change it to j.invoicestatemnt_r.Status__c.
Rajesh SriramuluRajesh Sriramulu

Hi,

 

Same thing to below code also.

 

 j.invoicestatemnt_r.Status_c. make sure you change it to j.invoicestatemnt_r.Status__c.

 

 j.invoicestatemnt_r.Status_c. make sure you change it to j.invoicestatemnts__r.Status__c.

 

confirm me that what is invoicestatemnt__c and relation to item__c.?

 

Regards,

Rajesh.

Puja_mfsiPuja_mfsi

Hi,

In salesforce there are two types of object : standard and custom.

To differentiate between these two objects salesforce append __c at the end of Custom Object .

 

You need to go some basic fundamentals book :

http://www.salesforce.com/us//docs/fundamentals/salesforce_creating_on_demand_apps.pdf

http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf

http://www.salesforce.com/us/developer/docs/pages/salesforce_pages_developers_guide.pdf

 

 

beginner apexbeginner apex

but i tried it not solve again i have error , 

 

error msg :Error: Compile Error: Didn't understand relationship 'invoicestatemnt_r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 3 column 31

Sunny670Sunny670
invoicestatemnt_r replace with invoicestatemnt__r
Puja_mfsiPuja_mfsi

Hi,

please change your code with the below code:

 

trigger handledseatpriceChange on seat__c (after update) {

              //update invoice items associated with open invoices

             List<Item__c> openItems =[SELECT j.seat_price__c , j.seat__r.price__c FROM Item__c j WHERE                        

                                                                j.invoicestatemnt__r.Status__c = 'notavailable' AND j.seat__c IN : Trigger.new  ];

}

 

You need to put API name of fields instead of Label name .In salesforce every custom fields have api Name ends with __c and relationships __r.

You don't need to use "j.seat__r.Id" because the lookup fields contains Id itself.you simply put "j.seat__c".

beginner apexbeginner apex

thanking you  , i have error

beginner apexbeginner apex
sorry , i cleared my error , thanking you