getting an error when creating a media folder on Document_AfterNew Event
Hi,
My code for creating a new media folder is not working when I move it on the document_afternew event. It is working if I use the document_beforepublish event but my problem with this is the media folder is created everytime the document is published.
Hi Sherry, I believe the AfterNew event handler fires before the document has actually been created, as you might have noticed sender is still an object at this point and not a document. Oddly I think Document.New should work... failing that you could make a property like "newDoc" and move it if the property is set 0 and then set the property to 1 after the move.. It wouldnt work if you were copying the document though...
getting an error when creating a media folder on Document_AfterNew Event
Hi,
My code for creating a new media folder is not working when I move it on the document_afternew event. It is working if I use the document_beforepublish event but my problem with this is the media folder is created everytime the document is published.
Here is my code.
Can anybody help me how to solve this?
Hi Sherry, I believe the AfterNew event handler fires before the document has actually been created, as you might have noticed sender is still an object at this point and not a document. Oddly I think Document.New should work... failing that you could make a property like "newDoc" and move it if the property is set 0 and then set the property to 1 after the move.. It wouldnt work if you were copying the document though...
Just a few thoughts
is working on a reply...