You need to sign in to do that
Don't have an account?
Federico Sosa
Why do I need to use Schema instead a Dml
Hi,
My question is: why do we need to use the Schema to get some information instead using a Dml to get the same information?
An example:
contactRTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByName().get(CONTACT_RECORDTYPE_NAME).RecordTypeId;
OR
contactRTypeId = [SELECT Id FROM RecordType WHERE Name = :CONTACT_RECORDTYPE_NAME].Id;
Thanks in advance,
Federico.
My question is: why do we need to use the Schema to get some information instead using a Dml to get the same information?
An example:
contactRTypeId = Schema.SObjectType.Contact.getRecordTypeInfosByName().get(CONTACT_RECORDTYPE_NAME).RecordTypeId;
OR
contactRTypeId = [SELECT Id FROM RecordType WHERE Name = :CONTACT_RECORDTYPE_NAME].Id;
Thanks in advance,
Federico.
Aadryan
Save SOQL.. Governor Limits ;-)