Sending notification to external application ERP

2

Good morning, I am trying to send a notification to the ERP of an external application, but I must be doing something wrong, because although no error in the code, no notification appears in ERP. What is wrong? Thank you.

Example:

    Public Sub MostraNotificacao()

    Dim objPlatform As New Interop.StdPlatBS900.StdPlatBS
    Dim objConfApl As Interop.StdPlatBS900.StdBSConfApl = New Interop.StdPlatBS900.StdBSConfApl
    Dim objStdTransac As Interop.StdBE900.StdBETransaccao = New Interop.StdBE900.StdBETransaccao

    objConfApl.Instancia = "Default"
    objConfApl.AbvtApl = "ERP"
    objConfApl.Utilizador = "xpto"
    objConfApl.PwdUtilizador = "xpto"
    objConfApl.LicVersaoMinima = "9.00"

    objPlatform.AbrePlataformaEmpresa("DEMO", objStdTransac, objConfApl, eTipoPlataforma, "")

    objPlatform.InterfacePublico.MDI.Notificacoes.MostraMensagem("Notificação", "Teste de notificação", False)
    'ou
    'objPlatform.PainelNotificacoes.MostraMensagem("Notificação", "Teste de notificação", False)       

    objPlatform.FechaPlataformaEmpresa()
End Sub
    
asked by anonymous 26.12.2018 / 11:58

1 answer

3

Good morning,

From what I see, this code is not running inside the ERP shell, right?

Notifications are only shown if invoked within the shell. The code is correct, the notification is triggered correctly, you just have no where to show it.

Try a simple code like this in VBA to see if notifications are shown.

Private Sub FichaClientes_DepoisDeGravar(ByVal Cliente As String)

    PlataformaPRIMAVERA.MDI.Notificacoes.MostraMensagem "Gravação de Cliente", "Cliente [" & Cliente & "] gravado com sucesso."

End Sub
    
26.12.2018 / 13:49