deleting a PropertyType and all data stored with them
Hi
I'm looking to delete a great deal of data and a PropertyType on a document type, but I need help.
The case: I have a document type with the alias "user". It has a property of the property type "noderelations" which is a derivation of the "ultimate picker" propertytype. I have a lot of documents with of "user" document types with a lot of "noderelations" on each. At a certain point I would like to delete all this data and alter the "source node" of the "noderelations" property type. I figured the easiest way would be to delete the PropertyType and thereby dumping all data using it, and then create a new "noderelations" with another "source node" for it.
But I get a System.NullReferenceException on an object when I get to the pt.delete() method.
Can anyone tell me the way to do it or perhaps show me another way of accomplishing the above case problem?
The Code:
PropertyType pt = new PropertyType(DocumentType.GetByAlias("user").getPropertyType("noderelations").Id); pt.delete();
I have debugged, even with the umbraco source code and found that It is first when the SQLHelper is trying to delete from the dbo.cmsPropertyType table, that the exception is thrown. Anyone?
deleting a PropertyType and all data stored with them
Hi
I'm looking to delete a great deal of data and a PropertyType on a document type, but I need help.
The case: I have a document type with the alias "user". It has a property of the property type "noderelations" which is a derivation of the "ultimate picker" propertytype. I have a lot of documents with of "user" document types with a lot of "noderelations" on each. At a certain point I would like to delete all this data and alter the "source node" of the "noderelations" property type. I figured the easiest way would be to delete the PropertyType and thereby dumping all data using it, and then create a new "noderelations" with another "source node" for it.
But I get a System.NullReferenceException on an object when I get to the pt.delete() method.
Can anyone tell me the way to do it or perhaps show me another way of accomplishing the above case problem?
The Code:
PropertyType pt = new PropertyType(DocumentType.GetByAlias("user").getPropertyType("noderelations").Id);
pt.delete();
Thanks a lot!
I have debugged, even with the umbraco source code and found that It is first when the SQLHelper is trying to delete from the dbo.cmsPropertyType table, that the exception is thrown. Anyone?
is working on a reply...