1

I created a workflow and the objective is to send a reminder email to any open item 7 days prior to the deadline date. I am not sure what I am doing incorrectly. Found below is the workflow that I created.

Do you see what is incorrect? Thanks for your assistance.

Workflow

Pause for 7 days, 0 hours, 0 minutes

If CurrentItem:Status equals Open

Email CurrentItem:Receiver

1

I would not do that. SharePoint is not the best with long running workflows. Using SharePoint designer workflows in this fashion takes some doing with multiple lists and such that work off each other.

Barring a completely custom solution, I would at either:

  1. Using a scheduled task to check the items and send the email
  2. Using a scheduled task to start a workflow. You only really need this if you need to take action on each item.

See Below as an example of starting a workflow via PowerShell:

Source: http://www.mysharepointadventures.com/2012/06/start-a-workflow-using-powershell/

#Site and List  
$SPAssignment = Start-SPAssignment 
$web = Get-SPWeb "http://your-site" -AssignmentCollection $spAssignment 
$site = Get-SPSite "http://webservices.rcrtom.com.au"
$listToCancel = "your-list";
$web.AllowUnsafeUpdates = $true;

#Output file
$Today = Get-Date -Format "dd-M-yy"
$outFile = "c:\CancelWorkflowScript-Log-$Today.txt"

#Workflows to Remove
$wfToStart= "Name of workflow"

#List Name  
$list = $web.Lists[$listToCancel]; 

#Workflow Manager
$manager=$site.WorkFlowManager
$association=$list.WorkFlowAssociations | where {$_.Name -eq $wfToStart}
$association.AllowAsyncManualStart = $true
$association.AllowManual = $true

# Iterate through all Items in List and all Workflows on Items.  
    #Filtered List
    Write-Host "Restarting workflows.."
    foreach ($item in $list.Items) { 
        if ($item["Status"] -ne "Completed") {
            $data=$association.AssociationData
            $wf=$manager.StartWorkFlow($item,$association,$data)
            Write-Output "$wftoStart started on " $item.Name | Out-File $outFile -Append
        }
        else {
            Write-Output $item.Name " - is completed " | Out-File $outFile -Append

        }
    }
Write-Host Finished.
$web.Dispose() 
$site.Dispose()

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.