How to modify component's metadata?

I want to modify the Metadata information of the component through vcHelpers.VcmFile .

But after the modification, the updated information is not shown in the component’s metadata, why?

There seems to be a bug in VcmFile. Whenever there’s no attribute e.g. Description given to the component previously, it’s ignored and not created by the VcmFile helper.

So to work around it, you have to give the component some Description (even just a space is enough) when saving it (with the UI). After that the attribute is created for the component and VcmFile is capable of writing to it.

I hope it will get fixed to the next release.

Hi ,jouha!

Thanks for your replay.

But I don’t understand the meaning about " you have to give the component some Description (even just a space is enough) when saving it (with the UI)".

Can you help me with a case to introduce about this?

Thanks a lot!

Hi!

Sorry for being a bit confusing…

When you (first time) save the component you need to type something into the description in order to change that entry afterwards with VcmFile helper.

So the entries are not created to the actual .vcmx file if the field/attribute is empty when saving the component and the VcmFile is not able to create such (due to bug/implementation) afterwards.

Hope this clarifies it!

houha,

Thank you very much!

I have successfully solved this problem through the method you gave.