1

I have a eventreciever for item updates that have following method:

public override void ItemUpdated(SPItemEventProperties properties)
        {
            base.ItemUpdated(properties);

            if (!HandleEvent(properties))
            {
                return;
            }

            var item = properties.ListItem;

            EventFiringEnabled = false;

            if (IsPublished(item))
            {       

            }

            EventFiringEnabled = true;

} 

Here is the method for IsPublished:

private bool IsPublished(SPListItem item)
{
    return item.Level == SPFileLevel.Published;

}

I need to somhow stop it from publishing, how can I do that??

1 Answer 1

1
public override void ItemCheckingIn(SPFeatureReceiverProperties properties)
{
  base.ItemCheckingIn(properties);
  //Major Version
  if(..){
   properties.Cancel = true;
   properties.ErrorMessage = "you cannot publish!";
  }

 }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.