Posts

Showing posts from July, 2024

Visual Force Email Templates being sent as blank by Automated Process User

This might happen if an automated process user updates a record and then uses the same record to send an email using the Visual Force email template. Example of email template: Hi, XYZ has submitted {!relatedTo.Name} for your re-approval. The following title of a known issues article in Salesforce is: VF Workflow Emails are Blank when the records are Last Modified by "Automated Process" user Solution: To replace/override the automated process user by any user who has required permissions. step 1: Login to workbench step 2: Use below POST endpoint /services/data/v58.0/tooling/sobjects/PlatformEventSubscriberConfig step 3: JSON body should appear below: {     "BatchSize" : "50",     "DeveloperName" : "",     "MasterLabel" : "",     "PlatformEventConsumerId" : "01qXXXXXX..", // APEX Trigger's ID     "UserId" : "005XXXX..." // User's ID } step 4: Hit Execute, that will ove

How to Give Permissions to Automated Process Users or System Context Users

Image
What is Automated Process Users Automated Process Users are special users created automatically by Salesforce, are essential to the execution of automated jobs and background processes. These users are essential for executing tasks that require no direct human intervention, such as: Flows: Automated Process Users can run Flow automations that perform actions like updating records, sending emails, or creating tasks. Approval Processes: They can act on behalf of users in approval processes, ensuring that approvals move forward even without direct user interaction. Scheduled Jobs: These users can run scheduled jobs that perform maintenance tasks or batch data processing. 1. How to fetch automated process user using SOQL? SELECT ProfileId, name FROM User WHERE Alias = 'autoproc' 2. How to give permission of apex class to automated process user step 1: visit following link <ORG_BASE_URL>/_ui/system/user/ProfileApexClassPermissionEdit/e?profile_id=<Automated_Process_User