0

I have a process the goes as follows:

  1. User requests edit of document (not in SP) through a custom UI
  2. System adds a copy of document to SP using service method
  3. SP stores doc and provides URLs to System
  4. System streams URL to user Browser causing doc to open in native application
  5. User checks document out using native application
  6. SP creates copy on users
  7. User makes changes and saves without checking document in.
  8. User continues to edit document and finally checks document in.

In SharePoint I would like to understand how to detect the difference between the user action taken at step 7 and step 8. When the user checks the document in I would like to have SharePoint inform System that the document is checked-in. I do not want System to be informed whenever the user executes step 7 (interim saves).

  • Is that about writing an event receiver (server-side)? – Evariste Mar 25 '16 at 15:09
  • I guess I am asking the best method to accomplish what I am asking. Would writing and event receiver be that? My issue is that I do not have confidence in what the team that supports SP in my org offers as a solution. The solution they are offering is running a basic workflow and in the workflow check for the check-in comment in the attributes. This necessitates that a user enter a comment and I don't want to require comment entry. – Coralogre Mar 25 '16 at 15:14
  • Arf, no, please, not a workflow... See my answer in a few minutes! :) – Evariste Mar 25 '16 at 15:22
0

A workflow for such a task is definitely not a good idea. Workflows are heavy, buggy, slow, complicated to implement (correctly) and most of all are visible/annoying in the UI for users who never asked anything.

The best approach IMP, if you can afford it (i.e. if you have SharePoint development resources available) is to create an event receiver (ER). That ER is written in C#, and registered on the doc lib (registration can be made by C# code as well, try to avoid XML/declarative registration approaches). From that ER, you monitor ItemCheckedIn event and you're done.

  • And I take it that the ItemCheckedIn event is not fired when the item the item is added to SP (steps 2 and 3 above) nor when interim save is performed in step 7, correct? – Coralogre Mar 25 '16 at 16:26
  • Yup, correct, the ItemCheckedIn event is only raised when the user explicitely checks-in the file. – Evariste Mar 25 '16 at 16:29

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

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