What are some use cases for using the schema class?



What are some use cases for using the schema class?..

Answer / 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

More Salesforce Interview Questions

What is test class and why do we need it?

0 Answers  


Write a trigger to insert a contact and user when the account is created?

0 Answers  


Explain different relationships in SFDC?

0 Answers  


Which permission is required to set the running user other than you in dashboard? : salesforce admin

0 Answers  


What is an Auto-Response Rule?

0 Answers  






What is a lead?

0 Answers  


What are the different types of object relations in salesforce? How can you create them?

0 Answers  


In trigger, lets say you have system.debug() statement after adderror() method. Will system.debug() be statement executed in trigger after adderror() method?

0 Answers  


Do you know about trigger.new?

0 Answers  


What are the different api's in salesforce ?

0 Answers  


How to undelete a record from recycle bin with the help of dml?

0 Answers  


What is trigger.old and when do you normally use it?

0 Answers  


Categories