Tag: apex

  • Apex: Converting Lists to Sets, and Sets To Lists

    As many Salesforce Apex programmers know, in Salesforce it’s pretty much an unchallenged best practice that all code should be able to handle bulk inserts, updates, etc. When adhering to this best practice, it’s really common to use sets, or lists as parameters in functions. Sometimes, there’s a need to convert between lists, or sets, […]

  • How to read cookies set by JavaScript in a Salesforce Apex Class

    How to read cookies set by JavaScript in a Salesforce Apex Class

    I recently had a requirement to have JavaScript create a cookie and then read it in later by an Apex class. You would think you could simply create a cookie in JavaScript and then read it in Apex using the exact same name as the cookie, but that’s not exactly the case. Cookies that need […]

  • Apex How to Get a List of Fields Set on an sObject

    I recently had a requirement to dynamically determine what fields had been set or queried on a sObject, so that a comparison could be done on what was actually stored in Salesforce’s Datastore. Surprisingly, there’s no way method on the sObject that let’s you tell what’s actually been queried or set. So without further ado, […]