開発者は、販売記録のリストを表示する Lightning Web コンポーネントを作成しています。 営業担当者ユーザーは、各レコードの手数料フィールドを表示できる必要があります。営業アシスタントユーザーは、手数料フィールドを除くレコードのすべてのフィールドを表示できる必要があります。 コンポーネントが両方のユーザーに対してエラーなしで機能するようにするには、これをどのように強制すればよいでしょうか?
正解:B
UsingSecurity.stripInaccessibleensures compliance with field-level security (FLS) and prevents users from accessing fields they do not have permission to view. In this scenario: The commission field is inaccessible to Sales Assistants, andSecurity.stripInaccessiblewill automatically remove this field from the result set. It prevents runtime errors when a user without proper access attempts to retrieve restricted fields. Reference:Apex Developer Guide: Security.stripInaccessible