Error: Guest users are not permitted to perform this operation: Caused by Flow action – “Post to Chatter”

Introduction You may get this error when a flow has action – Post to Chatter and record is being created using Guest user. This is as expected as Guest User can not create Chatter Feed in the system. Workaround No, you cant access Chatter with Guest User Content. No matter what you do, if you …

Error: Guest users are not permitted to perform this operation: Caused by Flow action – “Post to Chatter” Read More »

Using Userinfo.getSessionId in LWC Throws Invalid Session Id

PROBLEM After Summer ’17, Salesforce disabled it while using in Lightning Domain to enforce the security measures. Here is Salesforce known issue: https://issues.salesforce.com/issue/a028c00000qQ1F3AAK/summer17–generating-a-session-id-from-lightning-domain-provides-invalid-session-id Solution – Named Credential Use Named Credential to get the session id. Steps: Once you’ve logged in there, the refresh token is saved and used by the named credential. From there, you …

Using Userinfo.getSessionId in LWC Throws Invalid Session Id Read More »

Recalculate Formula Fields Dynamically (without save)

From the Documentation: Recalculates all formula fields on an sObject, and sets updated field values. Rather than inserting or updating objects each time you want to test changes to your formula logic, call this method and inspect your new field values. Then make further logic changes as needed. See https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_sobject.htm Note that this method doesn’t recalculate …

Recalculate Formula Fields Dynamically (without save) Read More »