0

I am currently facing a rather annoying problem: Everytime a project is completed in our ERP system, a corresponding item in a SharePoint list is created. This part basically works (but there is more, of course).

However, there is also a workflow associated with that list that is supposed to be triggered whenever an item is created in that list (it basically just sends an email to whoever was in charge of the project, but that is beside the point). And now I am told that this workflow has not been triggered in some time. I can reproduce the problem; also, when I add an item to that list manually, the workflow is triggered and runs as expected.

Apparently, this problem occurs under certain (vaguely specified) circumstances, because the program that creates the list items talks to SharePoint using the System / farm manager account. So here is my first question: We are currently running SharePoint 2013 (on-premises) and the admin tells me we are actually in the process of migrating to SharePoint 2016, and from there to 2019. Will this affect my problem?

As part of this whole process, I already query the Sharepoint user account of the project lead, and I would like to just add the item under that user account. But so far I have not been able to find out how to do that, or if it is even possible. So is this an approach worth pursuing?

There are some other things we could try, such as sending the email directly from the program that transfers the projects from the ERP system to the SharePoint list, or creating a dedicated SharePoint user for this purpose.

However, I have the requirement to leave the workflow alone as much as possible, i.e. SharePoint should continue to send the emails. Also, I have been told that changes like adding users are not an option until the migration to SharePoint 2019 is complete.

Is there any hope I can solve this problem without waiting for the migration to SharePoint 2019 (I have a feeling that one is going to take a while)?

(Just in case it matters, the program that creates the SharePoint list items is written in C# and uses the Microsoft.SharePoint.Client Nuget package v14.0.4762.1000 - any attempts to use the SharePoint.Client package (v15.0.0) have resulted in confusion and anger because of some missing unresolvable dependency.)

Thank you very much for any input!

1

1 Answer 1

1

Workflows will not run under the system account. This account is not set to run workflows at all; at least not automatically when items are updated, created, or deleted. This will not show up as an error in the workflow history or ULS logs. You can try putting an impersonation step in the workflow before it is fired to see if you can get it to work that way. Not sure if the system account will trigger that either.

You can try taking the elevated privilage part off your code and create a SharePoint group where users can modify lists allowing them to run the workflows with their own account. Just add that group to that list or those lists only for now until you can find out a better way to get it done. The system account is your problem though. Hope this helps.

2
  • In our case, an external program is adding items to the list; we are going to add a new user for that specific purpose. Which is what we should have been doing in the first place.
    – krylon
    Commented Aug 23, 2019 at 10:07
  • 1
    Always use service accounts for backend and external processing :). Good luck to you!
    – lazoDev
    Commented Aug 24, 2019 at 15:16

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.