You need to sign in to do that
Don't have an account?
decentshail
Data Type changed: Picklist to multi select picklist
Hi All,
I have to changed the data type of field (say Region__c) from picklist to multi picklist. But issue is this field is used in many apex classes and trggers in prod. Is there any way to change the data type without deploying the classes and trigger again.
Thanks,
Shail
No issue in it you don't need to deploye any page which is using this field. Just deploye this updated field. Every thing will remain intact after you change picklist to multi-select picklist. You can confirm it by opening your page, it will show up multi-select picklist. That will confirm you that all pages are in tact.
If your picklist field is used in apex class or trigger, then am afraid you can not change its data type.
You first need to comment out the places where you are refering it then change the data type of field > Now remove the comments from classes and triggers > Deploy all classes and pages to production.
There is no way out per my knowledge.
Thanks
Ankit Arora
Blog | Facebook | Blog Page
One more concern here, are you using any validation rule or workflow rule etc where you are refering this field?
Hi Shahsi,
Ankit is right. We can't change the data type of field in prod if this field is already used in some trigger and apex class only solution is comment the lines using this field, change the data type and deploy the apex class, trigger uncommenting.
there is some tool used in some orgnization which do this type of stuff not sure about type of application java/apex.
Yes thats correct, You need to comment out the statements, and about the tool, iam not aware but I can suggest the way by which we used to do it.
I hope you are using Eclips, if not use it. Make a search in all classes and triggers, use ctrl + H , it will show up all apex class and triggers with this field comment out all the places , change the field type and againg uncomment all.
The thing is you need to comment all instances and then change the data type and then again uncomment the classes.
Doesn't seems to have another option. So if the reply helped you then please mark it as solution.
Thanks
Ankit Arora
Blog | Facebook | Blog Page