Public Sub seeCAPInvoiceWarnings() Dim oInvoice As CAPInvoice Set oInvoice = New CAPInvoice Dim oWarn As IBBWarningRule oInvoice.Init fe_application.SessionContext '' Set oWarn to oInvoice object Set oWarn = oInvoice '' loop through all available warnings and output their description Dim i As Integer i = 1 Do While i <= oWarn.Count Debug.Print i & ": " & oWarn.Description(i) i = i + 1 Loop '''' While loop outputs: '''' 1: There are open Purchase Orders for this Vendor. '''' 2: There are unapplied credit memos for this vendor. '''' 3: This invoice may cause you to exceed the current credit limit of $0.00 for this vendor. '''' 4: This invoice is a duplicate. '''' 5: The invoice amount and 1099 total amount no longer match. '''' 6: The post date for this Invoice is different than the invoice date. '''' 7: The application post date is different from the application date for one or more applications. '''' 8: Invoice approval status will be changed to Approved in order to save. '' Override a specific rule with: oWarn.OverrideWarning(5) = True '' any code here that would normally show warning will now not show warning oInvoice.CloseDown Set oInvoice = Nothing End Sub
Disclaimer: We provide programming examples for illustration only, without warranty either expressed or implied, including, but not limited to, the implied warranties of merchantability and/or fitness for a particular purpose. This article assumes you are familiar with Microsoft Visual Basic and the tools used to create and debug procedures. Our Customer Support can help explain the functionality of a particular procedure, but we will not modify, or assist you with modifying, these examples to provide additional functionality. If you are interested in learning more about the VBA and API modules, contact your account manager.