After searching i tried to rename instance variable but still getting error. Updating selmeter.name.getDescribe() to TER_Meter__c.name.getDescribe() does remove the error but that isnt helping me to get length of field of every record in list. All i want is to get length of name field from the list of TER_Meter__c records to check if its length is less than 13. Where am i going wrong
List<TER_Meter__c> meterList = new List<TER_Meter__c>([SELECTName,Id,PAS_MSID_Effective_From__c,PAS_MSID_Effective_To__c FROM TER_Meter__c]);
for(TER_Meter__c selmeter : meterList)
{
Schema.DescribeFieldResult meterNameLength = selmeter.name.getDescribe();
if(meterNameLength.getLength()<13)
{
system.debug('looong');
}
}