Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8327029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T00:57:53+00:00 2026-06-09T00:57:53+00:00

I thought this would be a lot easier, however I’m unable to find a

  • 0

I thought this would be a lot easier, however I’m unable to find a way to determine in my event handler if it is the FIRST check-in of the file..

You see, I’m breaking role inheritance, and selectively inheriting permissions for files in doc libs, yet I wish to do it only once, during the first check-in of the file.

I’ve tried adding an entry to ‘SPListItem.Properties’ in the ItemAdded event in order to indicate if the file is new, however the moment I do ‘SPListItem.Update()’ it vanishes..

I’ve played with the ItemCheckingIn and ItemCheckedIn events with no success…

My only hope at the moment is adding a SPField to the ContentType to indicate if new file or not, but I really wish to avoid it..

ANY IDEAS????

PLEASE HELP ME!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T00:57:55+00:00Added an answer on June 9, 2026 at 12:57 am

    So I got a solution for this.
    I’m sorry I can’t post code here, I do not have access to internet on my dev machine.
    It should be good enough for everyone.

    Solution:
    During the CheckingIn event I try to access the file using the SHAREPOINT\system(“SPSecurity.RunWithElevatedPrivileges()”). During the first check-in the file is new and not accessible to other users besides the uploader.

    So if I fail getting the file with SHAREPOINT\system it means its new, and I save its Guid in a dictionary in my EventHandlers class.

    Then in the CheckedIn event I simply check if the dictionary contains the Guid of the current item, if it does – FIRST CHECK-IN, if it does not – NOT FIRST CHECK-IN.

    Of course after I’m finished with the file I remove the entry from the dictionary.

    Hope it helps, if you got any questions you are welcome to ask 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay at first I thought this would be pretty straightforward. But I can't think
I thought this would be fairly simple but it turns out not to work
I thought this would be fairly easy, but I'm totally baffled. I want one
I thought this would be very easy. I downloaded the JDK, extracted src.zip, modified
I thought this would be pretty easy but I'm running into all sorts of
I thought this would be easy. The Google makes me think otherwise. What I
OK so I thought this would be pretty simple but it's tripping me up..
Before I throw something ugly together I thought this would be a good one
Ok, I thought this would be simpler but I was probably wrong.. My parser
I've been reading through regex and I thought this would work but it doesn't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.