Tuesday, February 24, 2015

OnBase Unity Workflow script to create a note

Below is a method that creates an OnBase note which is attached to the doc being processed.
It accepts a string which will the text that is meant to show in the note.

private void createNote(string noteText)
{
    //Create a Note with the error message
    NoteType noteType = _app.Core.NoteTypes.Find("<note type>");
    NoteModifier noteMod = _args.Document.CreateNoteModifier();

    //Properties of the Note
    NoteProperties noteProps = noteMod.CreateNoteProperties();
    noteProps.Text = "Validation Issue" + Environment.NewLine + "Error               Message: "+ noteText;
    
    //Create the New Note
    Note newNote = noteType.CreateNote(noteProps);
    noteMod.AddNote(newNote);
    noteMod.ApplyChanges();

    //_app.Diagnostics.Write("Note Added");
}

1 comment:

  1. Stay committed to your decisions, but stay flexible in your approach. See the link below for more info.

    #committed
    www.ufgop.org

    ReplyDelete