Your code looks legit (the new document will not be published using this code, but I gather you're aware of this)
The error makes me think about the properties on the documenttype and the datatypes connected to these properties. Did you check that all the properties on the documenttype are correct? Are you able to create a new document of this type using the Umbraco backend?
Well, there are more properties on the document type, but as long as I only save the document and not publish I should be home free, right? Also, it is possible for me to create a document of this type in the backend.
I don't think there's any difference regarding properties whether you publish the document or not.
Are one of the properties on your document type some kind of dropdown, so when you're saving the document in the backend, theres a default value provided for the property. Maybe that could explain why you can't save from code where you're not setting a value for the property.
I solved my problem, and I'll post my solution, although I don't like how it worked out.
First of all, I switched the site from Integrated Mode to Classic Mode, because the admin was acting up (when i logged in to the frontend, none of the admin sections showed any child nodes).
Then i deleted all document properties on that document type, and recreated the exact same properties. The property types are as follows:
Textstring
Textbox Multiple
Member Picker
Upload
All properties are mandatory. Saving works now. I haven't tried changing the site back to Integrated Mode, but that's the only thing that has actually changed.
Document.MakeNew exception
Hi! :)
I'm trying to develop a usercontrol that creates a new document. But as soon as I call Document.MakeNew(), an exception is thrown:
I have made sure that all of the parameters to the method are correct. What am I doing wrong?
Umbraco Version: 4.6.1
what's your code look like?
Sorry, the code is as follows:
And the ascx is as follows:
Your code looks legit (the new document will not be published using this code, but I gather you're aware of this)
The error makes me think about the properties on the documenttype and the datatypes connected to these properties. Did you check that all the properties on the documenttype are correct? Are you able to create a new document of this type using the Umbraco backend?
Regards
Jesper Hauge
Well, there are more properties on the document type, but as long as I only save the document and not publish I should be home free, right? Also, it is possible for me to create a document of this type in the backend.
I don't think there's any difference regarding properties whether you publish the document or not.
Are one of the properties on your document type some kind of dropdown, so when you're saving the document in the backend, theres a default value provided for the property. Maybe that could explain why you can't save from code where you're not setting a value for the property.
Regards
Jeper Hauge
I solved my problem, and I'll post my solution, although I don't like how it worked out.
First of all, I switched the site from Integrated Mode to Classic Mode, because the admin was acting up (when i logged in to the frontend, none of the admin sections showed any child nodes).
Then i deleted all document properties on that document type, and recreated the exact same properties. The property types are as follows:
is working on a reply...