Loading
Salesforce から送信されるメールは、承認済ドメインからのみとなります続きを読む

Apex:outputField and certain Lightning components are no longer supported when Edit permission is disabled

公開日: Jul 12, 2023
説明
This article details impacts to Apex:outputField and Lightning components that depend on Edit permission to properly render.  When Edit permission is removed from Guest Users, edit operations will not be available in the field/components. 

Timeline: Guest User Object Permission Changes are slated to be turned off for custom objects and certain standard objects with the roll-out of the Winter ‘21 release. However, you can activate the “Opt Out of Enforcing Guest User Object Permission Changes” update to  keep these permissions unchanged until Spring ‘21 release. After your org updates with the Winter ‘21 release, you can no longer activate this update, and these permissions are permanently removed in the Spring ‘21 release.  

Impacts
Apex:outputField:  The apex:outputField with inline edit is not supported if Edit permission on the object is not enabled. Since the inline edit feature makes the outputfield editable,  guest users require Edit permission for the component to work properly.  When the Edit permission is no longer available on Guest User profiles, the apex:outputField will only render in read-only mode.

Sample Use Case: When a user double clicks on a field, it becomes editable if they have Edit permission. The field remains in read-only mode, if Edit is not enabled.
 
Example
<apex:outputField value="{!SalesforceObject.FirstName}">
  <apex:inlineEditSupport event="ondblClick"/>
</apex:outputField>



Lightning components: The below components will not work for guest user scenarios when object Edit  permission is not enabled for guest users.

The following components require object Edit permission and Read/Write record access to render in edit mode.
 
  • lightning:recordEditForm and lightning:inputField  - Shows error message
  • force:recordEdit - Shows error message
  • lightning:recordForm - If only object Read permission is granted and/or record access is Read Only, the components render in Read Only mode, edit operation is not possible.
  • File Upload screen component in Flows:  Stops working for guest users
解決策
Workarounds:
Activate the “Opt Out of Enforcing Guest User Object Permission Changes” critical update to retain Edit (and other permissions) until the Spring ‘21 release.

Record modification needs for Guest Users should be addressed by executing such updates in Apex methods that reside in classes running in “without sharing” mode, coupled with encryption / decryption of resources. Other UI components like lightning:input and force:inputField can be used. 

Alternatively, run flows in system context. This new mode allows the standard flow actions “Get Records” and “Update Records” to work for the Guest User without the need for apex actions.

Get more details here:  Guest User Record Access Development Best Practices



Additional Resources:
ナレッジ記事番号

000393226

 
読み込み中
Salesforce Help | Article