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
Hm_inviHm_invi 

deploying the changes made to object and fields from sandbox to production.

Hi, 
I'm new to salesforce deployments. 
I have a task to delete some 20 fields and records. 

I have made changes to all the dependent apex classes, removed the necessary fieldsets in lightning pages inorder to delete these fields.
Developed a SOQL query to remove the necessary records.
I hade done all of this successfully in the sandbox. 

But how can i deploy this into production using changesets (or)
Should i make changes to the few lines of code in the production also? and delete the fields manually each in production?
Should i be running this SOQL in the production environment to delete the records or what is the process.

is it manditory to use changesets if the changes are few. My changes to implement may take around 30-45 minutes.

Thanks for your help.
 
ShirishaShirisha (Salesforce Developers) 
Hi,

Greetings!

You can delete the fields in the Production using destructiveChanges.xml and also deploy the changes from sandbox to production using Package.xml.

Please find the sample way of creating the destructiveChanges.xml file which includes all your fields which need to be deleted.

https://salesforceoke.blogspot.com/2018/09/salesforce-metadata-api-delete-field.html

Please mark it as best answer if it helps you to fix the issue.

Thank you!

Regards,

Shirisha Pathuri