Skip to main content

Posts

Showing posts with the label Apex

Populate email body on custom CKEDITOR email editor in Salesforce.com

Other than using out-of-the-box Salesforce email editor , there are some scenarios where you need to build your custom email editor. You can build a custom email editor using CKEDITOR HTML editor. Once you build the custom editor , you will face the issue while fetching the body of the template. To display the email body in a HTML format from the predefined email templates , you can send the email using apex and then rollback immediately and fetch the email body in correct HTML format.  Here is the sample code :- Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); String toAddress = 'testemaildomain@test.com'; String templateId = '<Fetch Id of email template>' // Set the template id for which we need the HTML formatted body. email.setTemplateId(templateId); email.setWhatId(<Object Id>); email.setSaveAsActivity(false); email.setTargetObjectId(contactId); email.setToAddresses(new String[] {toAddress }...

Customize Service Console Standard Feeds using Salesforce.com Chatter ConnectApi

Salesforce Service Console feeds gives a holistic view of all the actions happening on cases which your agents can refer for quick summary of all that is happening on that case. It is also useful when the cases are transferred to some other support agent. There is some limitations in the feed we see on service console which might require you to customize Since not all feed actions are in detail. For example if you see an email feed , it contains whole body of the email , where as a feed on a new case related object created will contain only the record name or auto-number by  default. Though you can add a compact layout for the object which will allow you to add more fields in the feed but here we have a limit of 255 character on each field. Example : Suppose you add these fields in case compact layout then these will appear in the feed where each field e.g Subject can contain maximum of 255 characters Case Number Subject Status These standard fee...