Loading
システム管理者に対するフィッシング耐性MFA・全従業員ユーザーMFAの適用のお知らせ 続きを読む
Scalability
ApexGuru Antipattern: Schema.getGlobalDescribe() Not Efficient

ApexGuru Antipattern: Schema.getGlobalDescribe() Not Efficient

Using Schema.getGlobalDescribe() to retrieve metadata for a single known SObject isn’t efficient. This method causes unnecessary overhead, decreases performance, and increases the latency of the associated entry point.

Scope

Detection and recommendation

Detection Example

apex
Schema.DescribeSObjectResult dsr = Schema.getGlobalDescribe().get('Case').getDescribe();

Recommendation

Use the getSObjectType() method to retrieve the metadata.

Schema.DescribeSObjectResult dsr = Case.sObjectType.getDescribe();
 
読み込み中
Salesforce Help | Article