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
Iam using the code for document .copy in api usercontrol
i am using this code but i get this error
Document
doc = new Document(Convert.ToInt32(Request.QueryString["id"]));
doc.Copy(doc.Parent.Id, doc.User);
but i get this error:
What version of umbraco?
Check that doc is not null..
i am using teh latest version its not working
using
umbraco.presentation.nodeFactory;
not availabl ein teh new version That i am using
string newName; User author = User.GetUser(0); TextBox tb1 = this.txtNewName; newName = tb1.Text; string copyNodeID; copyNodeID = lblNodeId.Text; Document childDoc = new Document(int.Parse(copyNodeID)); childDoc.Copy(childDoc.Parent.Id, author, true);
foreach (Relation r in Relation.GetRelationsAsList(childDoc.Id)) {
Document newDoc = new Document(r.Child.Id); int idd = newDoc.Id; newDoc.Text = newName; newDoc.getProperty("VesselName").Value = newName; newDoc.getProperty("dir").Value = ""; newDoc.getProperty("position").Value = ""; newDoc.getProperty("date").Value = ""; newDoc.Publish(author); umbraco.library.UpdateDocumentCache(newDoc.Id); r.Delete();
}
this is my code but i get this error of OBJECT NOT SET TO A REFERENCE OF AN OBJECT
What line is giving the error?
the publish is giving error
]));
// Document childDoc = new Document(1069);
childDoc.Copy(childDoc.Parent.Id, author,
);
.GetRelationsAsList(childDoc.Id))
{
(r.Child.Id);
idd = newDoc.Id;
newDoc.Publish(author);
umbraco.
.UpdateDocumentCache(newDoc.Id);
it does not work dont know why??
You should try saving the document before publishing it.
the problem was in the implementing interface in the code giving a get set value its fixed now thanks
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
Document.Copy() any idea??
Iam using the code for document .copy in api usercontrol
i am using this code but i get this error
Document
doc = new Document(Convert.ToInt32(Request.QueryString["id"]));
doc.Copy(doc.Parent.Id, doc.User);
but i get this error:
Method not found: 'Void umbraco.cms.businesslogic.web.Document.Copy(Int32, umbraco.BusinessLogic.User)'.
What version of umbraco?
Check that doc is not null..
i am using teh latest version its not working
using
umbraco.presentation.nodeFactory;
not availabl ein teh new version That i am using
string newName;
User author = User.GetUser(0);
TextBox tb1 = this.txtNewName;
newName = tb1.Text;
string copyNodeID;
copyNodeID = lblNodeId.Text;
Document childDoc = new Document(int.Parse(copyNodeID));
childDoc.Copy(childDoc.Parent.Id, author, true);
foreach (Relation r in Relation.GetRelationsAsList(childDoc.Id))
{
Document newDoc = new Document(r.Child.Id);
int idd = newDoc.Id;
newDoc.Text = newName;
newDoc.getProperty("VesselName").Value = newName;
newDoc.getProperty("dir").Value = "";
newDoc.getProperty("position").Value = "";
newDoc.getProperty("date").Value = "";
newDoc.Publish(author);
umbraco.library.UpdateDocumentCache(newDoc.Id);
r.Delete();
}
this is my code but i get this error of OBJECT NOT SET TO A REFERENCE OF AN OBJECT
What line is giving the error?
the publish is giving error
]));
// Document childDoc = new Document(1069);
childDoc.Copy(childDoc.Parent.Id, author,
);
.GetRelationsAsList(childDoc.Id))
{
(r.Child.Id);
idd = newDoc.Id;
newDoc.Publish(author);
umbraco.
.UpdateDocumentCache(newDoc.Id);
it does not work dont know why??
You should try saving the document before publishing it.
the problem was in the implementing interface in the code giving a get set value its fixed now thanks
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.