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
HI, I try to create Document type using console application. but it says
Value cannot be null.
public int CreateNewDocumentType(string title, string alias, string description) { User u = new User(0); DocumentType newDocument = DocumentType.MakeNew(u, "aasds"); // newDocument.Alias = alias; newDocument.Description = description; newDocument.IconUrl = "doc.png"; newDocument.Save(); Document.RePublishAll(); return DocumentType.GetByAlias(alias).Id; return 0; }
How can i solve that problem?
thanks.
When you mean console application you mean one that is not a website? If so then it wont work as the api needs the http context, there are webservice methods for creating documents etc you can call those from console application.
Regards
Ismail
thanks. Ismail.
i will go to webservice.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
Can not create DocumentType in console application
HI, I try to create Document type using console application. but it says
Value cannot be null.
public int CreateNewDocumentType(string title, string alias, string description)
{
User u = new User(0);
DocumentType newDocument = DocumentType.MakeNew(u, "aasds");
// newDocument.Alias = alias;
newDocument.Description = description;
newDocument.IconUrl = "doc.png";
newDocument.Save();
Document.RePublishAll();
return DocumentType.GetByAlias(alias).Id;
return 0;
}
How can i solve that problem?
thanks.
When you mean console application you mean one that is not a website? If so then it wont work as the api needs the http context, there are webservice methods for creating documents etc you can call those from console application.
Regards
Ismail
thanks. Ismail.
i will go to webservice.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.