Category Apex

Mention multiple users in the chatter post using Apex

The article explains how to post a chatter from Apex code and how to mention multiple users in the post. It describes a solution using an Apex Trigger and ConnectApi for notifying 'Account Reviewer' users about changes in Account ownership. The method ensures that all mentioned users are from the old and new owner regions.

Trigger Bell Notification from Apex Code

Trigger Bell Notification from Apex Code

The Winter '21 release introduces the custom notification from Apex code feature that alerts users to changes or updates. This is especially useful for foreground notifications of backend asynchronous code execution. The CustomNotification class can be configured in various ways and sent using Apex code. Methods include managing the title, body, sender, type, target record and page of the notification.

How to host your web page using force.com site

The Salesforce platform allows users to host a webpage or application accessible to the public without requiring login. Users create a visualforce page, then register a domain and create a new active site. Appropriate permissions must be set in public access settings to permit access to the visualforce page, apex class, and assorted objects.

Upload multiple files through Visualforce page

The post outlines a method to address issues like 'View state size limit exceeded', 'Heap size' limit, and file size limit while uploading multiple files simultaneously. This method uses JavaScript, Ajax, and Jquery to send or upload files through HTTP POST Request. The files are uploaded to the ContentVersion object in base64 format and a progress bar displays the upload progress. This solution circumvents size limits by handling the file upload through the Visualforce page.

Show the uploaded image on the detail page.

The author explains how to enable users to upload images to a Salesforce object record. The solution involves creating a Visualforce page to handle uploads and using the ContentDistribution object to obtain the 'ContentDownloadUrl' after file insertion. The image URL is placed within a rich text field to display on the record details page.

Sort wrapper class list in Apex

Sort wrapper list based on selected records. Visualforce page: <apex:page showHeader="false" controller="WrapperListSortCntrl" > <html> <head> <apex:slds /> </head> <body> <apex:form…

Material Designed DataTable In Visualforce Page.

Material design is a design language employing grid-based layout, responsive animations, transitions, and depth effects to optimize user experience. DataTable, a jQuery Javascript library plug-in, enhances features like fast search, pagination, and column sorting. The provided example demonstrates applying DataTable in a visualforce page for an optimised user experience.