8

I want to remove the Metadata Schema from a folder using the core service API. I have tried setting the MetaDataSchema and MetaData properties of the folder to null but this doesn't change anything.

var organizationalItem = (FolderData)client.Read(organizationalItemID, new ReadOptions());
organizationalItem.Metadata = null;
organizationalItem.MetadataSchema = null;
organizationalItem = (FolderData)client.Save(organizationalItem, new ReadOptions());

Any ideas what I am doing wrong?

  • How did you ensure that this does not changed anything? Did you check the value of organizationalItem variable at debug mode or you have checked the folder property in CME? If it is later case, check after clearing your cache and restarting the COM+ – Pankaj Gaur May 20 '13 at 14:05
  • @PankajGaur I figured it out, hopefully this will be useful to someone else. – Kevin Brydon May 20 '13 at 14:09
12

Looks like I have to set the MetaDataSchema to an "empty" LinkToSchemaData object instead of null

var organizationalItem = (FolderData)client.Read(organizationalItemID, new ReadOptions());
var emptySchema = new LinkToSchemaData();
emptySchema.IdRef = "tcm:0-0-0";
organizationalItem.MetadataSchema = emptySchema;
organizationalItem = (FolderData)client.Save(organizationalItem, new ReadOptions());

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.