How to reliably save the user who processed the Verification Task in the Document's Field?

Question

How to reliably save the user who processed the Verification Task in the Document's Field?

Answer

The following settings are available only for the Desktop Verification Station.

  1. Open the project in the Project Setup Station.
  2. Add the text Field called usernameField in the Document Definition.
  3. Go to Project > Project Properties > Stage Tools tab.
  4. Edit the Verification stage:
  5. Add an event handler On Task Close:
  6. Add the following script:

The script code:

using System;
try
{
    foreach( IDocumentItem document in TaskWindow.DocumentsWindow.Items)
    {
        TaskWindow.OpenDocument( document.Document );
        var section = document.Document.Sections[ 0 ];
        var name = "usernameField";
        if( section.HasField( name ) )
        {
            section.Field( name ).Text = FCTools.CurrentUserSession.UserName;
        }
    }
}
catch( Exception ex )
{
    FCTools.ShowMessage( "Error: " + ex.Message );
    CanClose.Value = false;
}

The script will save the user who processed the Verification Task in the usernameField Field of the Document Definition.

Have more questions? Submit a request

Comments

0 comments

Please sign in to leave a comment.