What are some use cases for using the schema class?

Answer Posted / apoorva mathur

By using Schema class you can retrieve data from server without SOQL query. for eg- get recordTypeId without soql query

Id contRecordTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByName().get('NameOfRecordType').getRecordTypeId();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the object in salesforce?

232


State the cause of error for insufficient privilege access in a partner community with external users. The user has proper owd and profile settings for any object.

288


What data types are supported by external id’s in salesforce.com ?

233


Can we change the grant access using the role hierarchy for standard objects?

298


Can we use slds directly in visualforce page? : salesforce lightning component

259






What creative solutions have you come up with to navigate around a governor limit?

271


What are governor limits in salesforce.com?

243


For which criteria in workflow “time dependent workflow action” cannot be created?

256


A workflow already exists on object. Now user want to add time dependent workflow action to it but not able to get an option to select time dependent action. What might be issue? : salesforce workflows and approval process

240


How many records can a select query return? How many records can a sosl query return?

252


What are the different ajax action tags? What does each do?

239


What is the difference between Custom Setting and Custom Labels and Custom Object?

262


What are the aggregate functions supported by salesforce soql?

266


What will happen if a field is hidden through field level security and user search a values in that field? : salesforce sharing and security

293


What is Apex?

272