Custom Metadata Types vs Custom Settings vs Custom Labels 💬 In plain words: Three lookalikes: Custom Metadata = configuration that DEPLOYS with your code (best for app settings). Custom Settings = org/user-specific values, changeable at runtime (hierarchy type is great for bypass switches). Custom Labels = translatable text for the UI. 📌 Example: API endpoint URLs per environment → Custom Metadata (deploys with code, sandbox vs prod values). A 'Bypass_Automation__c' checkbox an admin flips during data load → hierarchy Custom Setting. The word 'Submit' translated to Hindi → Custom Label. 🎬 Real-Life Example: The Fee Table Trapped Inside Code Skyline charges a different delivery fee per city. Apex needs those rates on every booking. The Old/Bad Way: if (city == 'Delhi') fee = 50. Else if (city == 'Mumbai') fee = 65. … Every rate change is a code change, a test run, and a deployment. Why this is bad: Business data is trappe...
Here is a solution to upload a file to a third-party system using Apex in Salesforce. Below is the FormData builder Apex class, which builds the required multipart parameters: public class FormData { private final static String Boundary = '1ff13444ed8140c7a32fc4e6451aa76d'; public enum EndingType { Cr, CrLf, None } /** * Returns the request's content type for multipart/form-data requests. */ public static String GetContentType() { return 'multipart/form-data; charset="UTF-8"; boundary="' + Boundary + '"'; } /** * Pad the value with spaces until the base64 encoding is no longer padded. */ private static String SafelyPad(String value, String valueCrLf64, String lineBreaks) { String valueCrLf = ''; Blob valueCrLfBlob = null; while (valueCrLf64.endsWith('=')) { value += ' '; value...