Update a permission set to ensure that the function we create can access data in our Salesforce org. A permission set is a collection of settings and permissions that give users and apps access to various tools and data in Salesforce.
Update the Functions Permission Set
When you connect your org to Salesforce Functions via the Functions Setup page, Salesforce creates a Functions permission set with minimal permissions. Update that permission set to give your function access to the Account object.
To update the Functions permission set, add the file force-app/main/default/permissionsets/Functions.permissionset-meta.xml, with contents:
--ignore-conflicts Runs the deploy command even if conflicts exist.
--target-org A username or alias for the target org. Overrides the default target org.
Outputs:
1Deploying v59.0 metadata to test-1234dbzjb@example.com using the v60.0 SOAP API.2Deploy ID: 0Af6t00000jWn3Status: Succeeded | ████████████████████████████████████████ | 1/1 Components | Tracking: 1/145Deployed Source6========================================================================================================7| State Name Type Path8| ─────── ───────── ───────────── ──────────────────────────────────────────────────────────────────────9| Created Functions PermissionSet force-app/main/default/permissionsets/Functions.permissionset-meta.xml
In VS Code, from the Command Palette, choose SFDX: Push Source to Default Scratch Org.
Tip
Product Retirement Announcement
Salesforce Functions is no longer available for purchase or renewal. To preserve the capabilities that Salesforce Functions provided to your org, deploy an alternative solution before your existing order term ends. See Salesforce Functions Retirement for more information on migrating your functions. Contact your Salesforce Account Executive for more information on Heroku.