You need to sign in to do that
Don't have an account?
Marc D Behr
Converting Custom Metadata field types
I am trying to convert a CMD field from Text to LongTextArea and it appears that you can't convert CMD fields once they are defined. Is this true and if so, why?
If I have a text field on an object, I can convert it to LongTextArea, but the same conversion on a CMD object does not appear to be possible. I am not finding any documentation that says I can't do this, but apparently I can't. Has anybody seen where it is documented that this is *not* possible? Without being able to convert the field (since the CMD being used in a SFDX package), it looks like it will take creating a new field, updating all of the code the references the old field, and then deleting the original field unless somebody else has another idea?
If I have a text field on an object, I can convert it to LongTextArea, but the same conversion on a CMD object does not appear to be possible. I am not finding any documentation that says I can't do this, but apparently I can't. Has anybody seen where it is documented that this is *not* possible? Without being able to convert the field (since the CMD being used in a SFDX package), it looks like it will take creating a new field, updating all of the code the references the old field, and then deleting the original field unless somebody else has another idea?
IMPORTANT
https://help.salesforce.com/articleView?id=custommetadatatypes_fields.htm&type=5&lang=en
Change Field Types for Custom Metadata:
If I have a Custom Metadata field of type Number and I want to change it to type Text, the only way is to create a new field, update all my code references to the new field, delete the old field, recreate the old field as a Text field, and then re-update my code references to the new field
https://success.salesforce.com/ideaView?id=0873A000000E6KHQA0
All Answers
IMPORTANT
https://help.salesforce.com/articleView?id=custommetadatatypes_fields.htm&type=5&lang=en
Change Field Types for Custom Metadata:
If I have a Custom Metadata field of type Number and I want to change it to type Text, the only way is to create a new field, update all my code references to the new field, delete the old field, recreate the old field as a Text field, and then re-update my code references to the new field
https://success.salesforce.com/ideaView?id=0873A000000E6KHQA0
Thanks. Not sure whay I was not able to find this, but glad to know that it is documented. Makes working with SFDX a bit more of a challenge, as modifying fields takes more steps.
Thanks for the pointer though!
Marc
It is a question of expert and I didn't find the rule at the first try either.
I began by trying something with Apex metadata type "retrieve" and "deploy" (relatively new directly in Apex) with no success.
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_class_Metadata_Operations.htm#apex_class_Metadata_Operations
The documentation of Salesforce is never dated and (without the version 44, 45?) so that could be obsolete and there are perhaps workaround indeed (sfdx ?).
Alain