Skip to main content
14 events
when toggle format what by license comment
Oct 16, 2020 at 20:15 comment added Charles Koppelman @sfdcfox Yes.... They coulda called the SObject Location "Place" to be consistent with established nomenclature by geocoders like Mapquest and Google.
Oct 16, 2020 at 20:13 comment added sfdcfox @CharlesKoppelman Yeah, I should have thought of that, lol. Still, nice to know we finally have a Location field. That's been a Salesforce Idea for ages. Thanks for the follow up on this, I have close to 10k answers, it's hard to keep them all up to date.
Oct 16, 2020 at 20:12 comment added Charles Koppelman docs for future reference: "When referencing the Location object in your Apex code, always use Schema.Location instead of Location to prevent confusion with the standard Location compound field"
Oct 16, 2020 at 20:10 history edited Charles Koppelman CC BY-SA 4.0
edited body
Oct 16, 2020 at 20:10 comment added Charles Koppelman Yes, I just saw that! Better is: Type.forName('Schema', objName). I'll make the change in line.
Oct 16, 2020 at 20:05 comment added sfdcfox @CharlesKoppelman They added a Location object + Location sObject. I amended the code that should work for all cases, so long as someone doesn't define a custom class named Schema (which pretty much breaks any org implementation).
Oct 16, 2020 at 20:04 history edited sfdcfox CC BY-SA 4.0
added 40 characters in body
Oct 16, 2020 at 19:59 comment added Charles Koppelman Gah!!! This was working great until Salesforce released the "Location" SObject!!!
Jul 24, 2017 at 17:57 comment added Avinash I believe number of objects shouldn't make a huge difference in this approach as we are looking for a specific object without global describe.
Jul 24, 2017 at 17:51 comment added sfdcfox @Avinash Actual performance depends on the number of objects in your org; global describe can get obscenely expensive in large orgs (it takes ~2000 ms in our org, for example). Global describes should definitely be avoided when possible.
Jul 24, 2017 at 17:46 comment added Avinash Btw, the average Apex CPU time for this approach is ~4.5 milliseconds. That is less than 10% of the getGlobalDescribe() approach.
Jul 24, 2017 at 17:40 vote accept Avinash
Jul 24, 2017 at 17:40 comment added Avinash This is exactly the approach I'm working on. I was stuck at getting sObjectType from string. Now, even that is out of my way. Thank you.
Jul 24, 2017 at 17:32 history answered sfdcfox CC BY-SA 3.0