function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AK-2AK-2 

Ant deployment issue

In my org, I have Lead object with multiple custom fields and all the fields except standard field Description and custom field ProductInterest__c are visible to the Custom – Sales Profile.
Activity object has two custom fields and all the activity fields except standard field Comments and custom field TaskDescription__c are visible to that profile.
 
Now I want to make the Lead.ProductInterest__c and Activity.TaskDescription__c visible to the profile through Ant. So, I created the Custom – Sales Profile.profile file and added it to the package. Here is the Custom - Sales Profile.profile xml:
 
<?xml version="1.0" encoding="UTF-8"?>
<Profile xmlns="http://soap.sforce.com/2006/04/metadata">
    <custom>true</custom>
    <fieldPermissions>
        <field>Activity.TaskDescription__c</field>
        <readable>true</readable>
        <editable>true</editable>
    </fieldPermissions>
    <fieldPermissions>
        <field>Lead.ProductInterest__c</field>
        <readable>true</readable>
        <editable>true</editable>
    </fieldPermissions>
</Profile>
I am not including the fields in the package since they are already in the org. I have included the package.xml at the bottom of this post.
 
When I run this script I noticed that the lead object FLS was updated correctly. However, when I look at Task object’s field level security, the following standard fields: Name, Public, Related To, Type and the custom field Hours__c  are now invisible (the visible checkbox is unchecked). I have been able to create this scenario in my Dev org multiple times.
 
Why is the FLS on fields not included in the Ant script changing? And why does it work correctly and only updates the fields I include in the script for the Lead object but not on Activity object?
Thank you.

package.xml:
 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
	
	<!-- Profile -->
	<types>
		<members>Custom - Sales Profile</members>	
		<name>Profile</name>
	</types>
	
	<version>32.0</version>
</Package>

 
ShashankShashank (Salesforce Developers) 
I see that there is an active investigation going on for this issue internally, and you are looped in. Please let me know if you need anything else.