以下の設定を行う
- ゲストユーザーにリードの読み取りと作成のアクセス権を付与する
- ワークスペース > 管理で「ゲストユーザーにパブリック API へのアクセスを許可する」を有効にする
- ゲストユーザーにリードタブへのアクセスを許可する
- ゲストユーザーにリードフィールドへの読み取り/アクセスを許可する
リードフォームコンポーネントで訪問者情報を取得する
https://help.salesforce.com/s/articleView?id=sf.networks_microsites_configure_lead_form.htm&type=5
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000LHttUSAT
ゲストユーザーへの必要なユーザー権限およびオブジェクト権限の付与
https://help.salesforce.com/s/articleView?id=sf.ls_guest_user_permissions.htm&type=5
Custom Apex and Implementation with Guest Users
Custom code, if well written, would have user-mode most of the time. But with a guest user, you won’t be able to update records without system mode. All APIs used by the guest user should be tested to make sure they are working. Even custom Apex inside an Integration Procedure or implementing VlocityOpenInterface may require solution change and refactoring.
カスタム Apex とゲストユーザーによる実装
カスタム コードは、適切に記述されていれば、ほとんどの場合ユーザー モードになります。ただし、ゲスト ユーザーの場合、システム モードなしではレコードを更新できません。ゲスト ユーザーが使用するすべての API をテストして、機能していることを確認する必要があります。統合プロシージャ内のカスタム Apex や VlocityOpenInterface の実装でも、ソリューションの変更とリファクタリングが必要になる場合があります。
現在、サイト ゲスト ユーザーは ContentVersion を挿入できません。
以下の IdeaExchange リンクを確認し、この機能に賛成票を投じてください。
また、このヘルプ記事も参照してください: https://help.salesforce.com/s/articleView?id=000394368&type=1
これを画面フローに置き換えて、そこでエラー ロジックを処理することができます。
設定
-
ゲストユーザーにサイトアクセスを提供する
ゲストユーザーは、ログインしなくてもExperience Builderサイトを表示できます。パブリックサイトへのすべてのゲスト訪問者は、同じゲストユーザーレコード(サイトごとに1つ)を共有し、同じアクセスレベルを持ちます。
I have set Organization wide address to singleEmailMessage seems to have resolved the issue:
OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = 'testorgaddress@test.com']; //replacing testorgaddress@test.com with my org wide email address
if ( owea.size() > 0 ) {
mail.setOrgWideEmailAddressId(owea.get(0).Id);
}
Without these lines of code it was working for any logged in user, But Guest User seems to be having some kind of trouble.
これらのコード行がなければ、ログインしているユーザーであれば正常に動作していましたが、ゲスト ユーザーには何らかの問題が発生しているようです。
I found out that I had two more sites only visibles switching to Salesforce classic. Get into the classic setup and search for sites, then check there the default owner of the records and choose an active one.
Salesforce クラシックに切り替えてのみ表示されるサイトがさらに 2 つあることがわかりました。クラシック セットアップを開始してサイトを検索し、そこでレコードのデフォルトの所有者を確認し、アクティブな所有者を選択します。
I got this to work in flow builder. After enabling the guest user upload, make sure the flow is running in system mode, then upload the file using the guest user Id as the related Id as mentioned above Then loop through the attachments and reassign the related Id to the records they need to be assigned to.
https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A96seSAB
これをフロービルダーで動作させるようにしました。ゲスト ユーザーのアップロードを有効にした後、フローがシステム モードで実行されていることを確認し、上記のようにゲスト ユーザー ID を関連 ID として使用してファイルをアップロードします。次に、添付ファイルをループして、必要なレコードに関連 ID を再割り当てします。に割り当てられた。
うまくいかない
-
Community Guest users are not supported in the default org.
This is expected because a guest / unauthenticated user cannot make chatter posts. You have to be authenticated to make a chatter post.
これは、ゲスト/認証されていないユーザーが Chatter 投稿を行うことができないためです。 Chatter 投稿を行うには、認証を受ける必要があります。 -
guest user cannot read records from asset object : 共設定をした後に別のエラー
Unexpected error: null asd 5007E00000HCun0QAD asdUpdate failed. First exception on row 0 with id 5007E00000HCun0QAD; first error:
INSUFFICIENT_ACCESS_OR_READONLY, insufficient access rights on object id: []
Experience Builder + Flow
The System Permissions -> Run Flow inside the permission set should be active, to see the flow
エラーメッセージと、フローが自動起動として機能する方法のために、これをバイパスする方法が見つかりませんでした。フローのおしゃべり部分を削除したところ、正常に動作するようになりました。
ゲストユーザ
ゲスト ユーザーは記事に投票できず、認証されたユーザーのみが投票できます。