Extend Note Type
If we want to add a specific note type we will extend the IDPINO Note Display Type enum and add the new value.
enumextension 50101 "Note Type" extends "IDPINO Note Display Type"
{
value(3; "Page")
{
Caption = 'Page';
}
}
From this point we must subscribe to any of the two related events, depending on the functionality we want to give it. Both events come from the IDPINO Internal Note Helper codeunit and receive as parameter the name of the customer/vendor linked to the note and the note list record.
First we have the OnShowCustomNotificationType event to handle the notes individually. This event will be executed every time you step through the list of notes and don't find any of type notification or alert. For this case we have prepared an example that shows how to open each Page type note in a new page.
[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;
On the other hand, the OnAfterShowInternalNotes event is executed only once when all the notes have been run through. We can use it, for example, to launch in a new window all the notes of type Page.
[EventSubscriber(ObjectType::Codeunit, Codeunit::"IDPINO Internal Note Helper", 'OnAfterShowInternalNotes', '', true, true)]
local procedure OnAfterShowInternalNote(SourceName: Text; var 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;