Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8501

Re: Is it possible to execute a code in my program based on a click event in SAP B1?

$
0
0

Hi Leon,

 

here it's a sample in VB:

 

Public Class ReconcileAction

    Public Event ReconcileComplete As EventHandler

 

    Protected Sub RaiseReconcileComplete(ByVal e As EventArgs)

        RaiseEvent ReconcileComplete(Me, e)

    End Sub

 

    Public Sub Reconcile()

        ' Some code to do the reconciliation

 

        RaiseReconcileComplete(New EventArgs())

    End Sub

End Class

And to use it:

 

Module Module1

 

    Friend WithEvents Action As ReconcileAction = New ReconcileAction()

 

    Sub Main()

        Action.Reconcile()

    End Sub

 

    Private Sub OnReconcileComplete(ByVal sender As Object, ByVal e As EventArgs) Handles Action.ReconcileComplete

        ' code to color the row red

        MsgBox("Reconciliation completed.")

    End Sub

 

End Module

Note that the Main() would be your click on the button that starts the reconciliation.

Then when the event is triggered by the ReconcileAction the message box will appear (you should replace the message box with the code to color the row red).


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn


Viewing all articles
Browse latest Browse all 8501

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>