Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gavin Williams 5 posts 86 karma points
    Jun 30, 2014 @ 15:39
    Gavin Williams
    0

    How to get destination id from BeforeMove event

    As part of implementing some custom approvals code, I want to intercept a content move and show the current location (parentId) and proposed destination location (?) when the BeforeMove event is fired. Is there any way I can capture the id of the destination chosen in the popup dialog so that I can pass it to my approvals code? This would be so that once the approval has been approved I can call the Move API and pass it the required id. I've googled around but the only examples I can find all use static hard-coded page ids.

  • Gavin Williams 5 posts 86 karma points
    Jun 30, 2014 @ 16:27
    Gavin Williams
    101

    Found the solution so posting here in case anyone else comes across this. Basically don't use the umbraco.cms.businesslogic.web.Document.BeforeMove event, use Umbraco.Core.Services.ContentService.Moving and Moved - these give you a lot more info in the Entity object and crucially the MoveEventArgs includes the ParentId for the desired destination.

  • 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.

Please Sign in or register to post replies