New answers tagged

0

We ended up (re)using a Custom Setting to store the default Commercial and Person Account record types, see the code below. When the sObject type of the record is Account, we use the 2 custom settings, if it is any other sObject type, we use the Record Type Describe to return the default record type for that object. private static Id getDefaultRecordTypeId(...


0

Performance tests exhibit that in the current release Schema.describeSObjects method perform three times faster than the path ((SObject)Type.forName(devName).newInstance()).getSObjectType().getDescribe() This means it is better to use just method Schema.describeSObjects which does fail without the Schema prefix in the name of the object. So it is possible ...


1

Actually Address and Location are both Compound Fields (System.Address, System.Location) and a SObject (Schema.Address, Schema.Location). These SObjects are used for Field Service Lightning. I have missed some small note in the bottom of the documentation page “Address” in Salesforce can also refer to the Address compound field found on many standard ...


2

In my thoughts, its not a good practice to throw exception each time when you can avoid it by checking field. The reason behind this would be when you throw an exception, code flow has to go extra mile in catching it and and doing some additional logging mechanism which is again increased line of code characters. As you already have a fieldsSet, which is a ...


Top 50 recent answers are included