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
mavsmavs 

help on Schema.DescribeFieldResult

Hi

 

I have a List of type ABC__c which have Account field API names.

 

By looping through the list i should get the fieldlabel and store it in Account list.

 

How can we achieve this? please help

 

 

Public List<ABC__c> lab=new List<ABC__c> ();
Public List<Account> Acctfieldnames=new List<Account> ();

for(Integer i=0;i<lab.size();i++)
        {
            SObject sname=lab.get(i);
            Schema.DescribeFieldResult G = Account.sname.getDescribe();
            Mstfieldnames.add(G);
         }

srisomsrisom

Not 100% sure what you are trying to do.  The Field label is a string - you would put getLabel() on your getDescribe().  But you are trying to store in a list of accounts which I don't understand - you would need new Account( .. some init ...) to do that

 

What are you trying to achieve