Forum Discussion
OS_Pizza
2 years agoContributor III
AndoAssuming that you want to trigger a procedure as soon as you click on Lock Workflow
1. Create a Workflow Event Handler that will trigger copy leveraging the wtk of the locked period.
Namespace OneStream.BusinessRule.WorkflowEventHandler.WorkflowEventHandler
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As WorkflowEventHandlerArgs) As Object
Try
Dim returnValue As Object = args.DefaultReturnValue
args.UseReturnValueFromBusinessRule = False
args.Cancel = False
Select Case args.OperationName
Case Is = BREventOperationType.Workflow.WorkflowLock
If args.isBeforeEvent = True Then
Dim Mywf As WorkflowUnitClusterPk = DirectCast(args.Inputs(0), WorkflowUnitClusterPk)
Dim timeName As String = brapi.Finance.Time.GetNameFromId(si, Mywf.TimeKey)
CopyData(timeName)
End If
End Select
Return returnValue
Catch ex As Exception
Throw ErrorHandler.LogWrite(si, New XFException(si, ex))
End Try
End Function
Sub CopyData(timeName As String)
'Write your SQL query to copy data according to the time value
End Sub
End Class
End Namespace
Related Content
- 11 months ago
- 11 months ago
- 12 months ago
- 8 months ago
- 11 months ago