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
SureshSuresh 

Difference between _r & _c

Hi,

Can I know when to use _r & _c .Can anyone explain with an easy example.


Regards,
Suresh
Pankaj_GanwaniPankaj_Ganwani
Hi, 

__c is used to denote the custom fields and custom objects in salesforce org, whereas __r is used to refer the parent object fields in their child object.

Example:
Suppose there is a object named as Student__c(custom object) in org and it is having lookup relationship with School__c(custom object) and lookup field api name is School__c as well. School object has Name, Rating etc. fields.

Then to refer the Rating field in child object record i.e. Student__c, we use School__r.Rating.