I want to add Page metadata Schema to a Page which does not contain any metadata Schema attached to it. How can we achieve this?
I'm currently using an external script. I have tried searching the syntax for doing this. However, none of them have specified the Interop syntax for doing it.
ItemFields metadata = p.MetadataFields; metadata["MetadataSchema"].value.Add("Page Metadata");
The above code throws the following error:
Object reference not set to an instance of an object.
I have also tried using syntax, that allows to add/update values of the text field in the Page, however that syntax does not seem to work for updating the metadata Schema.