Share via


SPAppInstance.CancelAllJobs method

Cancels each currently running lifecycle job for an app instance.

Namespace:  Microsoft.SharePoint.Administration
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Function CancelAllJobs As Boolean
'Usage
Dim instance As SPAppInstance
Dim returnValue As Boolean

returnValue = instance.CancelAllJobs()
public bool CancelAllJobs()

Return value

Type: System.Boolean
Returns true if any jobs existed for this app instance (and therefore were cancelled). This is the case even if the cancellations had no effect, as in the case where the only job was a job that cannot be cancelled, for example uninstallation. Returns false if no jobs existed.

Remarks

If multiple jobs exist, job cancellation is nontransactional. This means that if an exception is raised by this method due to concurrent modification of jobs, all, none, or some jobs may have been cancelled. In this case, the user should retry the cancellation.

See also

Reference

SPAppInstance class

SPAppInstance members

Microsoft.SharePoint.Administration namespace