Responding to Action Buttons (Post, Transfer, Copy, Delete, Void) in SOP Transaction Entry

In GPAddins, add an event handler

AddHandler Dynamics.Forms.SopEntry.SopEntry.ActionButton.ValidateBeforeOriginal, AddressOf oSOPTransactionEntry.ActionValidateBeforeOriginal

And here is the actual event code

In this example, we're stopping the user from voiding if there is a payment. 

    Friend Sub ActionValidateBeforeOriginal(sender As Object, e As CancelEventArgs)
 
    Dim strError As String = ""
    Try
        Select Case sender.value
            Case 1'post
            Case 2'transfer
            Case 3'copy
            Case 4'delete
            Case 5 'void
                Dim dblAmountReceived As Double = Dynamics.Forms.SopEntry.SopEntry.PaymentReceived.Value
                If dblAmountReceived > 0 Then
                    Common.globalmessagebox("Unable to void, this document has a payment")
                    e.Cancel = True
                End If
        End Select
    Catch ex As Exception
        'error handling code
    End Try
 
End Sub

 

 

 


RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences