<< Click to Display Table of Contents >>
ESign |
ESign(ObjName, [Description], [Action], [From], [To], [User], [Comment])
This method is used to validate a field change by using an electronic signature. When this method is used, the dialog box on the next figure is displayed.
Digital Signature dialog box
Parameters of the ESign method
Parameter |
Description |
---|---|
ObjName |
Text that contains a Tag name or another application object |
Description |
Text that contains a description for ObjName. This parameter is optional and, if omitted, this dialog box tries to retrieve data from ObjName's DocString property |
Action |
Text that contains an action to execute, such as "Value change". This parameter is optional and, if omitted, inserts an empty String in the Action field |
From |
Variant that contains the original value, or a state to change. This parameter is optional and, if omitted, inserts an empty String in the From field |
To |
Variant that contains the new Tag value, or a value to apply on Action. This parameter is optional and, if omitted, inserts an empty String in the To field |
User |
Returned text. Receives the login name selected on this dialog box. This parameter is optional and, if omitted, inserts an empty String in the User field |
Comment |
Returned text. Receives a comment typed on this dialog box. This parameter is optional and, if omitted, inserts an empty String in the Comment field |
When clicking , a window then opens to authenticate a user. If the Windows option is selected, the User name and Password fields are automatically disabled. Click Other user to select a user belonging to a network domain. In case the E3 option is selected, type information about a user belonging to an E3 Domain in the User name and Password fields.
Integrated login
This method returns True if users click OK, and if the User and Password fields are valid. Otherwise, if this dialog box is dismissed or if the login or password are wrong after three attempts, this method returns False. In case of failure, User and Comment are configured to an empty String.
Pre-defined comments are stored on Windows Registry. Only the last 26 comments are saved. Every time this window is created, the last comments are retrieved from Registry, and then used to populate a list box. If users provide a new comment, it is saved and the oldest one is discarded, in case there is no free position. If it is an already existing comment, then it moves to the top of the recent comments list. The next code contains a usage example of this method.
Sub Button1_Click()
Dim Tag, User, Comment
Set Tag = Application.GetObject("IO.Inputs.IO01")
If Application.ESign(Tag.PathName, , "Value Change", _
Tag.Value, 1, User, Comment) Then
If Tag.WriteEx(1) Then
Application.TrackEvent _
"Tag IO.Inputs.IO01 changed to 1 " &_
"by the user" & User, Comment
End If
End If
End Sub