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
Bhupender AgarwalBhupender Agarwal 

Custom Fields on Opportunity object is not visible after deployment to another org

Hi,

I am trying to migrate custom fields on Opportunity object from one org to another and I am using Salesforce CLI for the migration. I have created a package.xml file and successfully retrieved and deployed all the metadata associated with the custom fields to another org. However, when I checked the target org I don't see the custom fields under Fields and Relationships section.

I have read some online posts regarding this and some people have answered saying this could be related to profiles. I am the System Administrator in both Source and Target org and also checked the field-level security of the custom fields but still couldn't find a way to make the fields visible in target org. Please let me know if any information is needed from my end. 

Thanks in advance for any help you can provide.

Package.XML file I used:
 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Opportunity.Customer Success</members>
        <name>BusinessProcess</name>
    </types>
    <types>
        <members>Account.Data_GB__c</members>
        <members>Account.Files_GB__c</members>
        <members>Account.Instance__c</members>
        <members>Account.Prod_Org_ID__c</members>
        <members>Opportunity.At_Risk__c</members>
        <members>Opportunity.BST_Agreement_Sent__c</members>
        <members>Opportunity.BST_Agreement_signed_Date__c</members>
        <members>Opportunity.Baseline_Tests_Passing_Date__c</members>
        <members>Opportunity.Bugs_with_Cases__c</members>
        <members>Opportunity.Cases__c</members>
        <members>Opportunity.Clone_Org_ID__c</members>
        <members>Opportunity.Committed_BST_Plan__c</members>
        <members>Opportunity.Completed__c</members>
        <members>Opportunity.Contacts__c</members>
        <members>Opportunity.Courtesy_License_Expires__c</members>
        <members>Opportunity.Current_Generator_s__c</members>
        <members>Opportunity.Customer_Pitch_Call__c</members>
        <members>Opportunity.Customer_Withdrew__c</members>
        <members>Opportunity.Data_GB_Total__c</members>
        <members>Opportunity.Delivery_Installation_Status__c</members>
        <members>Opportunity.Deployment_Workflow__c</members>
        <members>Opportunity.Drop_In_Framework__c</members>
        <members>Opportunity.Execute_Days__c</members>
        <members>Opportunity.Execute__c</members>
        <members>Opportunity.Initial_BST_Plan_Documented__c</members>
        <members>Opportunity.Is_On_Hold__c</members>
        <members>Opportunity.License_Provisioned__c</members>
        <members>Opportunity.Lightning_Analytics_User__c</members>
        <members>Opportunity.Missing_Onboarding_Fields__c</members>
        <members>Opportunity.On_Hold_Date__c</members>
        <members>Opportunity.Onboard_Days__c</members>
        <members>Opportunity.Onboard__c</members>
        <members>Opportunity.Onboarding_Fields_Completed__c</members>
        <members>Opportunity.Operating_Systems__c</members>
        <members>Opportunity.PII_Required_by_Tests__c</members>
        <members>Opportunity.PII_in_Sandbox__c</members>
        <members>Opportunity.Pilot_Agreement_Signed_Date__c</members>
        <members>Opportunity.Post_Sandbox_Activities__c</members>
        <members>Opportunity.Preferred_Browsers__c</members>
        <members>Opportunity.Primary_Cloud__c</members>
        <members>Opportunity.Prioritized_Use_Cases__c</members>
        <members>Opportunity.Prod_Data__c</members>
        <members>Opportunity.Prod_Files_GB__c</members>
        <members>Opportunity.Prod_Instance__c</members>
        <members>Opportunity.Prod_Org_ID__c</members>
        <members>Opportunity.Qualify_Days__c</members>
        <members>Opportunity.Qualify__c</members>
        <members>Opportunity.Reason_for_Hold__c</members>
        <members>Opportunity.Reason_for_Withdrawal__c</members>
        <members>Opportunity.Red_Account_Report__c</members>
        <members>Opportunity.Region__c</members>
        <members>Opportunity.Repo_Access__c</members>
        <members>Opportunity.SB0__c</members>
        <members>Opportunity.Salesforce_Withdrew__c</members>
        <members>Opportunity.Sandbox_CS_Instance__c</members>
        <members>Opportunity.Sandbox_Cloned_Date__c</members>
        <members>Opportunity.Sandbox_Data_GB__c</members>
        <members>Opportunity.Sandbox_Files_GB__c</members>
        <members>Opportunity.Sandbox_Name__c</members>
        <members>Opportunity.Sandbox_Org_ID__c</members>
        <members>Opportunity.Sandbox_Pilot_Record__c</members>
        <members>Opportunity.Sandbox_Preview__c</members>
        <members>Opportunity.Sandbox_Type__c</members>
        <members>Opportunity.Signature_Customer__c</members>
        <members>Opportunity.Source_Org_Identified__c</members>
        <members>Opportunity.Special_Requirements__c</members>
        <members>Opportunity.Status_Comments__c</members>
        <members>Opportunity.Test_Account__c</members>
        <members>Opportunity.Test_Code_Repo__c</members>
        <members>Opportunity.Test_Code_Shared__c</members>
        <members>Opportunity.Test_Context_Switching__c</members>
        <members>Opportunity.Test_Data_Method__c</members>
        <members>Opportunity.Test_Data_Source__c</members>
        <members>Opportunity.Testing_Practices__c</members>
        <members>Opportunity.Testing_Technology__c</members>
        <members>Opportunity.Total_Days__c</members>
        <members>Opportunity.Use_Cases_Documented_Date__c</members>
        <members>Opportunity.Wave_Mobile_User_del__c</members>
        <members>Opportunity.Wave_User_del__c</members>
        <members>Opportunity.X3rd_Party_API_Access__c</members>
        <members>Opportunity.X3rd_Party_APIs__c</members>
        <name>CustomField</name>
    </types>
    <types>
        <members>Opportunity</members>
        <name>CustomObject</name>
    </types>
    <types>
        <members>Admin</members>
        <name>Profile</name>
    </types>
    <version>45.0</version>
</Package>

- Bhupender Agarwal
Harsh P.Harsh P.
Let me know, All fields are not visible or only particular one.?
Abdul KhatriAbdul Khatri
Please share the screen shot of the Field Level Security for that field. While migrating Custom Field from one org to another if you have not included profiles in the migration script then field level security doesn't get set even for the System Administrator automatically.

Did you also push the page layouts where those field suppose to be visible, if not then you might need to update the page layout automatically.
Bhupender AgarwalBhupender Agarwal
Hi Harsh, I have migrated 77 fields and I see only 3-4 of them after migration and rest all others are not visible.

@Abdul do you want me to provide the screenshot of Field Level Security for each field (I have 77 custom fields). Also, initially I have migrated only fields without a profile in package.xml. Could that be a cause of this issue? Also, I have not included page layout during the migration.

I'll try migrating page layouts and see if that solves my issue.
Abdul KhatriAbdul Khatri
No only screenshot for the one which is not visible would be fine.

If you migrated field without a profile as I said earlier they are not automatically get assigned to profile even for the Administrator.

If you added those field on the page layout then yes you need to include them part of your migration but you can also manually update the page layout. Are you not even seeing those fields even if you try to update the page manually.
Harsh P.Harsh P.
Go to the your profile and check the read access of those field. If it do not have an access of read it would not be visible.
If do not have read access then tick the read access for those field.Also check the visibility on page layout.
Hope it will help.......! 
Bhupender AgarwalBhupender Agarwal
Thanks for the replies, Abdul and Harsh.

@Abdul, yes I don't see the fields for adding it to page layout manually as well. As per your last comment, I retrieved Page Layout using package.xml and then tried to re-deploy the opportunity object but this time I ran into many other issues and found that Page Layout does have a dependency on other custom objects which in turn have a dependency on many other custom objects. Thus, it seems if I have to migrate the page layout I have to migrate many other objects as well. However, please find the screenshot of field level security of one of the custom field below:

Field Level Security screenshot for custom field (Baseline Test Passing)

@Harsh, I checked the Custom Field Level Security for System Administrator profile in source org and here is the screenshot for the same:
Custom Field Level Security from System Administrator profile

If you notice I don't see the custom field (Baseline Test Passing) in the profile section either. Please note that I have 77 custom field on Opportunity object and from the image you can see only 14 fields under Custom Field- Level Security section of System Administrator profile.

Please let me know if any other information is needed.

Thanks,
Bhupender Agarwal
Abdul KhatriAbdul Khatri
What you are seeing in the second screen shot under Custom Field-Level Security are the name of the SObject and ont the field names. You need to click on the Opportunity SObject to check the Field Security Level for that object. I think you mixed the two things here so get yourself clear here first.

Can you please share the screen shot of the Opportunity Page Layout and guide us how you are trying to find the field so we can be on the same page? Sorry asking too many questions.
Bhupender AgarwalBhupender Agarwal
Hi Abdul,

No issues that you ask many questions. Just wanted to be clear here that I am very new to all these and no prior experience with migration nor with the admin. I have a project to move one of our org and thus learning everything from online resources. I apologize for my lack of knowledge on this stuff and will try my best to implement the suggestion you have given above.

Here is the screenshot of the Field-Level Security of Opportunity object (I clicked Opportunity SObject this time :))
Opportunity Field Level Security

Please note that this is the image from Source org.

Regarding page layout, I see there are two-page layouts available. 1. Customer Success and 2. Opportunity Layout. For this org, I know that Customer Success page layout is applied to all the profiles (including System Administrator). Please see the screenshots below:

Customer Success Page Layout
There are other sections too apart from the one shown in the screenshot. Please let me know if you need a screenshot of the same too?

Also, I retrieved Customer Success page layout and tried to migrate the same but it looks like it has a dependency on many other custom objects and I have to have all those objects move along to make this page layout successful.

Please let me know if you need more information from me and thank you a ton for helping me with this.

- Bhupender Agarwal
 
Bhupender AgarwalBhupender Agarwal
Hi @Abdul,

Yesterday I re-deployed the metadata and now I can see all the custom fields. I think the problem was with the errors I was getting. When resolved all the errors (not related to deploying page layouts; this means my custom fields were not related to page layout) related to custom fields all of them got deployed successfully. Hence, we can close this thread.

Thanks,
Bhupender Agarwal