You need to sign in to do that
Don't have an account?
RSuzuki
What's the point of DescribeFieldResult.isCreateable() vs DescribeSObjectResult.isCreateable()?
Say I have a class that creates a new account.
To check for FLS for an insert operation I can call the isCreateable method on the DescribeSObjectResult:
if(Schema.sObjectType.Account.isCreateable()){
insert account;
}
So what's the point of for example Schema.sObjectType.Account.fields.Name.isCreateable() ?
I understand isUpdateable() on a field (some fields can be created but not updated). But isn't isCreateable the same thing on a field as it is on an object? if you can create an object, you should have the ability to create the required fields?
I'm asking this as I'm trying to fix some FLS errors that I got back on a preliminary security scan of my package.
To check for FLS for an insert operation I can call the isCreateable method on the DescribeSObjectResult:
if(Schema.sObjectType.Account.isCreateable()){
insert account;
}
So what's the point of for example Schema.sObjectType.Account.fields.Name.isCreateable() ?
I understand isUpdateable() on a field (some fields can be created but not updated). But isn't isCreateable the same thing on a field as it is on an object? if you can create an object, you should have the ability to create the required fields?
I'm asking this as I'm trying to fix some FLS errors that I got back on a preliminary security scan of my package.
For instance,If a user has create permission on object ,but in Field Level Security only view permssion is given to the user.Then isCreateable will be false for that field.In such cases isCreateable() can be used on fields.
Please refer below link which might help you in this
https://salesforce.stackexchange.com/questions/37282/difference-between-iscreateable-and-isupdatable-for-describefieldresult
Hope this helps you
If this helps kindly mark it as solved so that it may help others in future.
Thanks and Regards