You need to sign in to do that
Don't have an account?
Shephali Swarnkar
How to check Accessibility of merge field
Hi All,
'Schema.sObjectType.Contact.fields.Account.Name.isAccessible()'
using above code trying to check the Accessibility of Merge field "Account.Name" in Contact object but getting Error that Account is not a field in Contact.
"Compile Error: account is not a field of Contact ".
How to resolve this issue??
Thanks
'Schema.sObjectType.Contact.fields.Account.Name.isAccessible()'
using above code trying to check the Accessibility of Merge field "Account.Name" in Contact object but getting Error that Account is not a field in Contact.
"Compile Error: account is not a field of Contact ".
How to resolve this issue??
Thanks
For checking access of Account, Try something like this:
Schema.sObjectType.Account.fields.Name.isAccessible()
You might be aware of the following syntax:
Schema.sObjectType.ObjectApiName.fields.FieldApiName.isAccessible()
All Answers
Schema.sObjectType.Contact.fields.AccountId.isAccessible()
Thank You so much...Its working!!!
One more question on it. As you suggested to check the accessbility for parent object field we can do using ID field (eg. AccountId), is it like we dont need to check for other fields of parent object in child object???
Account Id will only check for the lookup field, Imagine if the FLS is turned off for other fields but not for AccountId.
Thanks
For checking access of Account, Try something like this:
Schema.sObjectType.Account.fields.Name.isAccessible()
You might be aware of the following syntax:
Schema.sObjectType.ObjectApiName.fields.FieldApiName.isAccessible()
For checking access of Account, Try something like this:
Schema.sObjectType.Account.fields.Name.isAccessible()
You might be aware of the following syntax:
Schema.sObjectType.ObjectApiName.fields.FieldApiName.isAccessible()
I think we dont need to check the fields accessibility on child object rather check on parent itself. please correct me if wrong.