+ Start a Discussion
Karna_ShivaKarna_Shiva 

How would a developer change the field type of a custom field on account object from a string to an integer?

How would a developer change the field type of a custom field on account object from a string to an integer?


a. Remove all references in the code, make the change in the declarative UI, and restore the references with the new type.

b. Make the change in the developer console, and then the change will automatically be reflected in the apex.

C. make the change in the declarative UI, and then the change will automatically be reflected in the apex code.

D. make the change in the declarative UI, then update the field type to an integer field in-the apex code.
sandeep@Salesforcesandeep@Salesforce
(a)

You just need to remove it from all reference points and then may make change. 
other wise you would get error as below :
There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Cannot change field type of a custom field referenced in Apex class or trigger: XXXXXX". 

Here XXXX is Apex Trigger or Apex class  name

Thanks 
Sandeep Singhal