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
[Error]
I get the following error having the main folder at level/depth 3, and creating a new item. ( only when creating new items the error occurs )
" DateFolders SortChildrenByDateProperty exception "The exeption is just a side effect btw.
[Structure]1. site 2. home 2. page 3. Datefolder main 4. month 5. year 6. items 2. page[Structure adding item]
1. site 2. home 2. page 3. Datefolder main 4. month 5. year 6. items 2. year 3. month 4. year 5. month 6. new added item 2. page
[ Quick fix ]Check in the Document_AfterSave if the parents are correct. After save is not needed on new items :)====The Document_New handler works fine. But the Document_AfterSave handler is creating the error.I saw that the parentId was wrong so i added a check
void Document_AfterSave(Document doc, SaveEventArgs e){ ...... Document parent, monthFolder, yearFolder, monthDoc = null, yearDoc = null; monthFolder = new Document(doc.ParentId);yearFolder = new Document(monthFolder.ParentId);parent = new Document(yearFolder.ParentId); // >> check if the monthfolder is of the datefolder type. If not, stop if( !_dateFolderDocType.Equals( monthFolder.ContentType.Alias ) || !_dateFolderDocType.Equals( yearFolder.ContentType.Alias ) ) return; ...... }
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
Deeper nodes (SortChildrenByDateProperty ex)
[Error]
I get the following error having the main folder at level/depth 3, and creating a new item.
( only when creating new items the error occurs )
" DateFolders SortChildrenByDateProperty exception "
The exeption is just a side effect btw.
[Structure]
1. site
2. home
2. page
3. Datefolder main
4. month
5. year
6. items
2. page
[Structure adding item]
1. site
2. home
2. page
3. Datefolder main
4. month
5. year
6. items
2. year
3. month
4. year
5. month
6. new added item
2. page
[ Quick fix ]
Check in the Document_AfterSave if the parents are correct. After save is not needed on new items :)
====
The Document_New handler works fine. But the Document_AfterSave handler is creating the error.
I saw that the parentId was wrong so i added a check
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.