How to drill down to the Work Diaries (Production)

0

I am implementing a drilldown for the PRIMAVERA ERP 9 Job Log records, but it does not open the required form:

My code:

Public Sub ExecutaEventoDrillDown_Processos(ByVal IdDT As String)
Dim objParametros As StdBEValoresStr
Dim objCampoDrillDown As StdBESqlCampoDrillDown

objCampoDrillDown = New StdBESqlCampoDrillDown

With objCampoDrillDown
    .Tipo = EnumTipoDrillDownListas.tddlEventoAplicacao
    .ModuloNotificado = "GPR"
    .Evento = "evtDD_GPR_DiarioDeTrabalho"
End With

objParametros = New StdBEValoresStr

With objParametros
    .InsereNovo("ID", IdDT )
End With

PSO.DrillDownLista(objCampoDrillDown, objParametros)

objCampoDrillDown = Nothing
objParametros = Nothing
End Sub 
    
asked by anonymous 10.12.2018 / 13:48

1 answer

2

The evtDD_GPR_DiarioDeTrabalho event does not exist.

The event to call is GPR_MostraManutencao , passing the maintenance category and the registry key to be edited.

Here is an example of a generic method for using this event:

Sub MostraManutencaoGPR(Manutencao As String, Chave As String)
Dim objCampoDrillDown   As StdBESqlCampoDrillDown
Dim objParam    As StdBEValoresStr

    ' Valida permissões
    If Aplicacao.Utilizador.AcedeOperacao("GPR", Manutencao) Then

        If Len(Chave) > 0 Then

            ' Inicializa o campo drilldown da manutenção
            Set objCampoDrillDown = New StdBESqlCampoDrillDown

            With objCampoDrillDown

                .ModuloNotificado = "GPR"
                .Tipo = tddlEventoAplicacao
                .Evento = "GPR_MostraManutencao"

            End With

            ' Inicializa os parâmetros da manutenção (chave)
            Set objParam = New StdBEValoresStr

            With objParam

                .InsereNovo "Manutencao", Manutencao
                .InsereNovo "Chave", Chave

            End With

            ' Abre a manutenção
            Aplicacao.PlataformaPRIMAVERA.DrillDownLista objCampoDrillDown, objParam

            ' Liberta recursos
            Set objCampoDrillDown = Nothing
            Set objParam = Nothing

        End If

    End If

End Sub

To edit a workbook, since the table key is the workbook ID, this method would be called this way:

MostraManutencaoGPR "DiariosTrabalho", "660"
    
10.12.2018 / 16:28