The OneStream Community is temporarily frozen until June 29th due to the ongoing maintenance. Please read the blog post here to learn more.
Forum Discussion
wolfee
1 year agoNew Contributor
Make document attachment required on journal
Hi Everyone,
Our business team would like to make it mandatory to attach a document to every journal entry. I know this can be done via a confirmation rule. However, one of our business partners ...
M_L_Spencer
1 year agoNew Contributor II
Hi there,
Guessing you probably solved this one already, but if you create a JournalsEventHandler business rule with the following, it will prevent a journal from being posted without an attachment.
Public Class MainClass
Public Function Main(ByVal si As SessionInfo, ByVal globals As BRGlobals, ByVal api As Object, ByVal args As JournalsEventHandlerArgs) As Object
Select Case args.OperationName
Case Is = BREventOperationType.Journals.PostJournal
'Attachment Check:
Dim wfClusterPk As WorkflowUnitClusterPk = si.WorkflowClusterPk
Dim Info1 As String = Nothing
Dim objList As JournalsAndTemplatesForWorkflow = BRApi.Journals.Metadata.GetJournalsAndTemplates(si,wfClusterPK,)
'Define counter
Dim x As Integer = 0
'Set cycle
For x = 0 To objList.Journals.Count - 1
'Get line items in current journals
Dim objJournalEx As JournalEx = BRApi.Journals.Metadata.GetJournalOrTemplate(si, objList.Journals.Item(x).Name)
'Check for attachment
If objJournalEx.Header.HasAttachments = False Then
Throw New Exception("Error: Journals must have supporting documents attached before posting")
Else
Return Nothing
End If
Next
End Select
End Function
End Class
Related Content
- 4 years agoAnonymous
- 4 years ago