You need to sign in to do that
Don't have an account?
mintotsai@dev.jasmine
Activity field level security reseting when using metadata api
When updating field level security for Activity fields for a profile using the Metadata api (from Rails Metaforce Gem), I am seeing the resetting of field level security for other fields.
For example, in the following code, when Activity.What is done, the Activity.Who is reset to not Visible.
MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'Who')
MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'What')
Here is the method for updating field level security,
def self.admin_profile_field_permissions(metadataClient, field)
puts 'Field Permission: '+field
metadataResponse = metadataClient.update_metadata(:profile, :fieldPermissions => [:field => field, :editable => true, :readable => true], :fullName => 'Admin')
puts 'Success=' + metadataResponse.success.to_s
end
The problem is only happening for the Activity object.
For example, in the following code, when Activity.What is done, the Activity.Who is reset to not Visible.
MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'Who')
MetadataUtils.admin_profile_field_permissions(metadataClient, 'Activity.'+'What')
Here is the method for updating field level security,
def self.admin_profile_field_permissions(metadataClient, field)
puts 'Field Permission: '+field
metadataResponse = metadataClient.update_metadata(:profile, :fieldPermissions => [:field => field, :editable => true, :readable => true], :fullName => 'Admin')
puts 'Success=' + metadataResponse.success.to_s
end
The problem is only happening for the Activity object.
Here is the code using the Apex Metadata Api:
Could someone from Salesforce look at this?