Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Does anyone know if this method can return the node id of the created content?
I've checked the documentation here: http://our.umbraco.org/documentation/Reference/Management-v6/Services/ContentService
I believe these methods return an instance of the created content, so from the return object you should be able to just check it's Id property.
Thanks it did indeed.
var contentService = ApplicationContext.Current.Services.ContentService;
var contentNode = contentService.CreateContent(name,parentId, docTypeAlias, 0);
//Get id of created content
int nodeId = contentNode.Id;
Sorry I was quick to assume this worked when all i get returned is 0 for the nodeId ?
Ok, anyone else who struggles with this there is a non documented method:
This works a treat.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted