Activity Forums Salesforce® Discussions How to change field type if the field is referenced? 

  • Nikita

    Member
    October 21, 2019 at 1:32 pm

    Hi Saddam,

    There are two ways to get this done that I know of. Assuming you're working primarily in a sandbox:

    • Comment out all the lines with that field in it in all classes and triggers.
    • Modify the field.
    • Deploy all the changed code and metadata to production
    • Uncomment all those lines of code
    • Deploy all the changed code to production

    or

    • Make a new field with a new name.
    • Change every reference in your code to that new field.
    • Deploy changed code and new metadata to production
    • Move over any data from the old field to the new field

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos