Code Completion is different when using Schema

8 views
Skip to first unread message

Wim Velzeboer

unread,
Jan 16, 2026, 12:33:23 PMJan 16
to Illuminated Cloud Q&A
Hi Scott,

I noticed that the following compiles well.

System.debug(Account.Top_Account_Name__c);
System.debug(Schema.Account.Top_Account_Name__c);

The code completion works perfectly for the first line. It lists all the possible fields.
But when I prefix it with "Schema" it doesn't list the fields.

I often use the "Schema" prefix to avoid conflicts with variable names that use the same name, like this::

Account account = new Account(Top_Account_Name__c = 'test');
System.debug(Account.Top_Account_Name__c);   // 'test'
System.debug(Schema.Account.Top_Account_Name__c);   // Top_Account_Name__c

Is that expected? Or is it possible to also have the fields listed when using Schema?

Screenshot from 2026-01-16 17-24-53.png
Screenshot from 2026-01-16 17-24-29.png

Scott

unread,
Jan 16, 2026, 12:35:28 PMJan 16
to Illuminated Cloud Q&A, wimvel...@gmail.com
That just sounds like a bug to me. Feel free to log it in the public issue tracker and that will help keep it on my radar to be addressed.

Regards,
Scott Wells
Reply all
Reply to author
Forward
0 new messages