On a sandbox I commented out references of a text area field from : ApexClass, ApexPage, EmailTemplate, 2 Flows, and a layout. I then was able to make the change of the data type just fine.

Now when I am trying to push my changes using a changeset on autorabit to the QA sandbox, I am unable to deploy as it fails on the CustomField saying:

Cannot change type due to existing data.

I looked at a few examples like Change datatype from Text to Text Area(Long) and Change field Data Type without removing all references to said field in Controllers and Classes where it says that there shouldn't be any data loss. So why am I seeing this error?

I also saw https://help.salesforce.com/articleView?id=000327186&language=en_US&type=1&mode=1 and I don't have any references to that field in formulas etc. "Where is this used" shows no usage anywhere.

Is there a better way to do this?

  • Is the commented out references to this field being removed from the ApexClass, etc in the same package? Aug 20, 2020 at 13:53
  • Yes they are being removed in the same package. @Kris Goncalves
    – kratos
    Aug 20, 2020 at 13:55


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.