I have a questions I hope someone has the answer to.
it is a 2010 workflow running on a SharePoint 2013 hosted environment.
The workflow was created by an "Admin account"
I have edited the workflow using my account which is part of the admin group on SharePoint. I am using SharePoint designer to edit the workflow.
The workflow doesn't throw any errors and my code should "work" in theory/practice because it is rather simple.
Here's the problem:
The workflow pauses until it reaches a date
-When it comes out of the pause, it seems to ignore my case statement.
All my debugging logs indicate it should go down an IF statement but it doesn't
One other IF statement works just fine coming out of the PAUSE.
Else if Current Item:Category equals value PTO
Category is a drop down field
The debug log says Category = PTO
Every item in the field statement is obtained from a Pick List!
I have moved this statement to the top of the IF list and it will still be ignored.
I don't understand why it is not dropping into this IF statement while another case it works fine.
Could it be a permission issue?
Related
I have a SharePoint 2013 list, within it I have a workflow that starts when a list item is updated. This workflow emails people regarding a data change to the list.
I also have a second workflow on that list that can only be run manually which will do some reporting on demand for an item on the list (user checks an item, goes to Workflows, and runs it).
The problem is: When the second manual reporting workflow runs, it also causes the list item update workflow to trigger, which in turn spams my users when no real data change occurred (other than the workflow status field), or at least, it's not a data change that I care about.
Question: How do I prevent the "update workflow" from starting when I'm running the manually-started reporting workflow?
When a item is approved from the manager task the workflow updates a entry in a calendar list with the status approved. This workflow fails sometimes with the following error.
The workflow could not update the item, possibly because one or more columns for the item require a different type of information. Access Denied
I have no idea why this happens. Here is my workflow code
Your images are not showing up so this is hard to diagnose, however it seems like you are trying to pass the wrong type of value to a variable, such as a string to a date/time.
I have an initial workflow in Sharepoint Designer that triggers whenever an item is created and also whenever an item has changed in the 'Employee' list .
Within second workflow I am updating the 'Employee' list and the workflow above is triggered.
Is there any way I can check in the intial workflow if the item has been updated by a user or if it was updated by a workflow. In the case if the item was updated by a workflow I would not want to trgigger it.
Many Thanks,
Through SharePoint Designer, you cannot cause an update to an item to not trigger workflows that are listening for it. But, you can cause the workflow to basically be skipped with one extra Step.
Try checking out this article at Microsoft Office, which discusses secondary workflow interactions in SharePoint Designer. In the first step, it identifies whether an item was created by a specific workflow, and cancels the workflow if it isn't. We just need to adapt this - if we successfully identify the item as being modified by your secondary workflow, then we want to cut off the first workflow.
You need to create a new Step in your initial workflow, and move it to the top. In it, choose the Compare Tasks Condition. In that condition, set field to be "Workflow Name", leave the operation as "equals", and set value to be the name of your secondary workflow. Then, add a Stop Workflow Action, specifying some appropriate workflow history message to indicate that the workflow was triggered by the secondary workflow so it was terminated.
( sharepoint 2007 )
i am creating a sharepoint workflow
this workflow is started when an item is created or changed in the list called ListA
this item has a field called user assigned
when the item is created this field is empty
the first step in the workflow is - grant item permission
in this step the creator of the item is granted contribute permission
the second step is to update field user assigned with the value created by of current item.
when the item is created its contribute permission are not with the user who is logged in . Thats why we use the firt step to give the user logged in the contribute permission. and after the first step has got executed . the contribute permissions are given to the user logged in and now he should be able to updated the user assign field as the next step of the workflow.
However the problem is that even before the first step of granting permissions has completed. the second step is executed and since the user logged at that time still doesn't have contribute permissions the workflow stops without updating user assigned field. if i could somehow produce a delay of about 5 seconds between the first and second step of the workflow my problem would be solved.
but I believe in sharepoint designer workflow the minimum pause is of 1 minute , which is much more than i require.
what should i do ?
Try to update SPListItem object by calling SPListItem.Update() and see if it helps.
If not, then just answer to your question: execute System.Threading.Thread.CurrentThread.Sleep()
And putting in a delay activity will serialize your workflow into database and only timer job will wake it up (which usally runs no more often than each 5 minutes, even if your activity delay is set to 1 minute).
in sharepoint designer workflow there is an option for set time portion of date/time
set time as 00:o5 for your date field(out put to one variable-userdefined variable name)
then pause until sources is workflow data field is your varaible name.--ok--> finish the workflow
Add a code item and use System.Threading.Thread.Sleep(5000);
I've got a scenario where I want a workflow to not run if a certain condition is true, otherwise to run when a list item is created. The scenario is for a people management system. If a new list item (staff member) is added to the list then the workflows job is to go between the various departments and get everthing setup. Eg payroll, IT account ect. One of the fields is Start Date that may or may not be entered. If it is entered then I don't want the workflow to run when the item is created. I want the policy on the list to start the workflow on that date. I can add some code into the workflow to end itself if the date is in the future but then this will show as completed on the list. This is a problem because the workflow shouldn't show that it's run as in effect it's waiting for the date to be correct.
In other words, is there something in onWorkflowActivated that allows me to stop the workflow from triggering so that nothing shows up in the site, in essence to suppress the workflow from running as if it was never triggered by the OnCreated event.
Can you add a new step at the beginning of the workflow to fill in the Start Date? I think this makes sense in terms of your workflow because the HR person has an action item on their plate: enter the start date.
Otherwise you could make Start Date a required field on the sharepoint list.
This is SharePoint Designer version, see if you can use the same activities in VS
Create a second workflow that executes the rules after StartDate is set
In the main workflow, create a step with the action 'Wait for Field Change in Current Item' and config it to 'StartDate not Empty'.
The next action will be a 'Start Workflow', executing the second Workflow you created.
You also have a Stop Workflow activity