ES | EN
  • Apps
  • Soporte
  • Sitio web iDynamics
    Mostrar / Ocultar índice

    Extender Tipos de Nota

    Si deseamos añadir un tipo de nota concreto, en este caso extenderemos del enumerado IDPINO Note Display Type y añadiremos el nuevo valor.

    enumextension 50101 "Note Type" extends "IDPINO Note Display Type"
    {
        value(3; "Page")
        {
            Caption = 'Page';
        }
    }
    

    A partir de este punto debemos suscribirnos a cualquiera de los dos eventos asociados, dependiendo de la funcionalidad que queramos darle. Ambos eventos proceden de la codeunit IDPINO Internal Note Helper y reciben como parámetro el nombre del proveedor/cliente asociado a la nota y el registro de la lista de notas.

    En primer lugar tenemos el evento OnShowCustomNotificationType para manejar las notas de manera individual. Este evento se ejecutará cada vez que recorra la lista de notas y no encuentre ninguna de tipo notificación o alerta. Para este caso hemos preparado un ejemplo que muestra como abrir cada nota de tipo Page en una página nueva.

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"IDPINO Internal Note Helper", 'OnShowCustomNotificationType', '', true, true)]
        local procedure OnShowCustomNotificationType(SourceName: Text; InternalNote: Record "IDPINO Cust./Vend. Int. Note")
        var
            InternalNotes: Page "IDPINO Cust/Vend Int. Nt. List";
        begin
            case InternalNote."Display Type" of
                InternalNote."Display Type"::"Page":
                    begin
                        InternalNotes.SetTableView(InternalNote);
                        InternalNotes.Run();
                    end;
            end;
        end;
    

    Por otra parte, el evento OnAfterShowInternalNotes se ejecuta una sola vez cuando ya se han recogido todas las notas. Lo podemos usar, por ejemplo, para lanzar en una ventana nueva todas las notas de tipo Page.

    [EventSubscriber(ObjectType::Codeunit, Codeunit::"IDPINO Internal Note Helper", 'OnAfterShowInternalNotes', '', true, true)]
    local procedure OnAfterShowInternalNote(SourceName: Text; InternalNote: Record "IDPINO Cust./Vend. Int. Note")
    var
        InternalNotes: Page "IDPINO Cust/Vend Int. Nt. List";
    begin
        InternalNote.SetRange("Note Type", InternalNote."Note Type"::Page);
        InternalNotes.SetTableView(InternalNote);
        InternalNotes.Run();
        InternalNote.SetRange("Note Type");
    end;
    
    Volver al principio Copyright © 2024 iDynamics Business Solutions