Páginas filhas
  • Como adicionar uma rotina de usuario no Event Viewer

Versões comparadas

Chave

  • Esta linha foi adicionada.
  • Esta linha foi removida.
  • A formatação mudou.

...

Bloco de código
titleEvento com mensagem em formato json string
#INCLUDE "FWEVENTVIEWCONSTS.CH"

User Function TstEW()     Local cEventID as character
    Local cTitulo as character
    Local jMsg as json
    Local jNotification as json
    
    jNotification := JsonObject():New()

    jMsg := JsonObject():New()
    jMsg["title"] := "cliente"
    jMsg["body"] := "Evento enviado com sucesso."
    jMsg["click_action"] := "notificar"
    
    jNotification["notification"] := jMsg
    
    cEventID  := "777" //Evento cadastrado na tabela E3
 
    cTitulo:='Teste do Event Viewer'      
     
    //Possibilidade da string em formato json disponível a partir da LIB Label 20220905
    EventInsert(FW_EV_CHANEL_ENVIRONMENT, FW_EV_CATEGORY_MODULES, cEventID, FW_EV_LEVEL_INFO, "", cTitulo, jNotification:toJson(), .T.)
 
Return

...