Copied to clipboard

Flag this post as spam?

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


  • Harm-Jan Abbing 62 posts 102 karma points
    Dec 14, 2012 @ 16:25
    Harm-Jan Abbing
    0

    Code in ContentImport_RecordImported fires when ContentImport_RecordImporting is canceled

    Hi Guys,

    I have some custom code in the ContentImport_RecordImporting event for checking a mutation date and cancelling when the date is the same or earlier than the local mutationdate. This works fine but the code i have in the ContentImport_RecordImported event always runs, even when the RecordImporting is cancelled.

    How do i make sure the rest of the events don't fire?

    Cheers,
    Harm-Jan

  • Richard Soeteman 4035 posts 12842 karma points MVP
    Dec 15, 2012 @ 06:47
    Richard Soeteman
    0

    Hi Harm-Jan,

    The status is stored in ImportAction, can be ImportAsNew, Skip, Overwrite. So create an if statement to exclude skip and you will be fine. Below sample code

            void ContentImport_RecordImported(object sender, RecordImportedEventArgs e)
            {
                if (e.ImportAction != ImportActions.Skip)
                {
                    //Not skipped
                }
            }


    Hope this helps you,

    Richard

  • Harm-Jan Abbing 62 posts 102 karma points
    Dec 17, 2012 @ 08:52
    Harm-Jan Abbing
    0

    That was it! Thanks Richard.

Please Sign in or register to post replies

Write your reply to:

Draft