André Andrade
André Andrade

Reputation: 313

In dynamics 365 on premise how to find the Field Security Profiles that a particular field has write access?

I usually need to find the field security profiles that a particular field is part of and to achieve that I always go through all the Field Security profiles to check if the field is present. Is there any way to accomplish that quickly? Does anyone know any XRMToolbox plugin or even an SQL query?

Upvotes: 0

Views: 24

Answers (1)

André Andrade
André Andrade

Reputation: 313

After taking a look at the database using "SQL 4 CDS" XRMToolbox plugin, I could create this query that helped me to find what I was looking for.

SELECT 
    fsp.FieldSecurityProfileId 'Profile ID',
    fsp.Name AS 'Profile Name',
    fp.cancreatename AS 'Can Create',
    fp.canreadname AS 'Can Create',
    fp.canupdatename AS 'Can Update'
FROM 
    FieldSecurityProfile fsp
JOIN 
    FieldPermission fp ON fsp.FieldSecurityProfileId = fp.FieldSecurityProfileId
WHERE 
    fp.AttributeLogicalName = 'logical_name'  -- Replace with the logical name of your field
    AND fp.CanUpdate = 4  -- 4 indicates "Allowed" and 0 indicates "Not Allowed" in Field Security settings

Upvotes: 0

Related Questions