Posts

Showing posts with the label APEX

Master Salesforce Automation with "Salesforce Automation with Salesforce Flow and Apex" by Om Prakash – A Comprehensive Review

Image
Those who seek to master automation and are salesforce admins, consultants, or developers should read the book: “Salesforce Automation with Salesforce Flow and Apex"" as it is written by Om Prakash who highly recommends it. This book provides comprehensive and easy-to-understand guidance for people who want to know how to use Salesforce Flow, Apex, and other forms of automation to improve their business operations. This book is reviewed by Nipunu Wijesinghe who has experience over 12 years in the IT industry, including 8 years specializing in Salesforce solutions. Author Background Om Prakash is a 5x Salesforce MVP and the founder and CEO of AppyCrown Private Limited. His extensive experience as a developer, architect, and mentor is easily identifiable throughout the book's pages as long as you are an active member of the Salesforce trailblazer community. Since Om is passionate about teaching and sharing knowledge, this book is useful for someone who is a novice or someon...

Javascript Remoting for APEX controller

Javascript remoting is the process that provides support for some methods in APEX controllers to be called via Javascript.The @RemoteAction annotation is currently available as a Developer preview.You have to contact Salesforce.com support to enable this feature.To use Javascript remoting, your request must take the following form: [<namespace>.]<controller>.<method>([params...,] <callbackFunction>(result, event) { // callback function logic }, {escape:true}); namespace is your organization's namespace. This is only required if the class comes from an installed packaged. controller is the name of your Apex controller method is the name of the Apex method you're calling params is the comma–separated list of parameters that your method takes callbackFunction is the name of the function that handles the response from the controller. It returns the status of the call and the method result. escape defines whether your response should be escaped (by defau...

Save an attachment in APEX

Attachment field allows users to be able to attach notes and attachments to custom object records. This allows you to attach external documents to any object record, in much the same way that you can add a PDF or photo as an attachment to an email. This option is only available when you are creating a new object. Here I have an example for save an attachment in APEX. /*****Controler*****/ public class status{ private final Applicant__c applicant; public Blob resume {get; set;} public String contentType {get; set;} public String fileName {get; set;} public status(ApexPages.StandardController stdController) { this.applicant=(Applicant__c)stdController.getRecord(); } public PageReference saveApplication() { try{ insert(applicant); }catch(System.DMLException e){ ApexPages.addMessages(e); return null; } if(resume!=null){ Attachment attach=new Attachment(); attach.Body=resume; attach.Name=filename; a...