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

Salesforce Integration Tutorial | Integrate Salesforce with Apps

Video in

This "𝐒𝐚𝐥𝐞𝐬𝐟𝐨𝐫𝐜𝐞 𝐈𝐧𝐭𝐞𝐠𝐫𝐚𝐭𝐢𝐨𝐧 𝐓𝐮𝐭𝐨𝐫𝐢𝐚𝐥" video by Edureka will help you understand what is Salesforce integration in detail. It will also address the various Salesforce integration…