We have several pending IT Shop requests that have been outstanding for several months.
Is it possible to abort requests that have been pending for > x days?
Manually in Manager or Object Browser or using a procedure?
We have several pending IT Shop requests that have been outstanding for several months.
Is it possible to abort requests that have been pending for > x days?
Manually in Manager or Object Browser or using a procedure?
Hi
You can build a DialogMethod which you can call within the Manager when you select the affected request(s). The following code is an example how a DialogMethod could looks like for canceling requests:
Dim blIsMultiSelectObject As Boolean = TypeOf(Base) Is VI.DB.MultiSelectObject
Dim sb As New StringBuilder
Dim strTitle As String = CStr(IIf(blIsMultiSelectObject, "Mehrfachstornierung ohne Benachrichtigung", "Stornierung ohne Benachrichtigung"))
Try
If Not Base.IsLoaded Then
MsgBox (#LD("Not possible in insert mode.")#, MsgBoxStyle.OKOnly Or MsgBoxStyle.Information, "Information")
Else
Dim strReasonHead As String = InputBox(String.Format("Bitte geben Sie für die {0} einen Grund ein", strTitle), strTitle, "")
If Not String.IsNullOrEmpty(strReasonHead) Then
If blIsMultiSelectObject Then
Dim msoPWO As MultiSelectObject = CType(Base, MultiSelectObject)
For Each objPWO As ISingleDbObject In msoPWO
Try
If Not objPWO.IsLoaded Then objPWO.Load()
objPWO.Custom.CallMethod("CancelOrder", objPWO.GetValue("UID_PersonInserted").String, strReasonHead)
Catch ex As Exception
sb.AppendLine(String.Format("{0} - {1}", objPWO.GetValue("DisplayOrg").String, objPWO.GetValue("DisplayPersonOrdered").String))
sb.AppendLine(String.Format("Fehler: {0}", ex.Message))
sb.AppendLine(" ")
End Try
Next
Else
Try
Base.Custom.CallMethod("CancelOrder", Base.GetValue("UID_PersonInserted").String, strReasonHead)
Catch ex As Exception
sb.AppendLine(String.Format("{0} - {1}", Base.GetValue("DisplayOrg").String, Base.GetValue("DisplayPersonOrdered").String))
sb.AppendLine(String.Format("Fehler: {0}", ex.Message))
End Try
End If
Else
sb.AppendLine(String.Format("Die {0} konnte nicht durchgeführt werden, da kein Grund angegeben wurde.", strTitle))
End If
End If
Catch ex As Exception
Throw New ViException(#LD("An error occurred in the method 'Storno ohne Benachrichtigung'")#, ex)
Finally
If Not String.IsNullOrEmpty(sb.ToString()) Then
MsgBox(String.Format("Bei der {0} sind folgende Fehler aufgetreten:{1}{1}{2}", strTitle, Environment.NewLine, sb.ToString()), MsgBoxStyle.OkOnly + MsgBoxStyle.Exclamation, strTitle)
Else
MsgBox(String.Format("Die {0} wurde erfolgreich ausgeführt.", strTitle), MsgBoxStyle.OkOnly, strTitle)
End If
End Try
Note: The example above is able to handle single and multi-selection. So you can select one or more request at one time to cancel them.
We are using the method to cancel requests which have been ordered and already assigned by a mistake, so we have assigned the appropriate DialogObject to the DialogMethod. So we can only cancel requests which are no longer in the approval process. If you want to cancel request in the approval process you have to assign the appropriate DialogObject to the DialogMethod.
-
Regards
Sven