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.
- Open the project in the Project Setup Station.
- Add the text Field called usernameField in the Document Definition.
- Go to Project > Project Properties > Stage Tools tab.
- Edit the Verification stage:
- Add an event handler On Task Close:
- 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.
Comments
0 comments
Please sign in to leave a comment.