stop the sign event?? - InfoPath Dev
in

InfoPath Dev

stop the sign event??

Last post 10-01-2008 03:45 AM by taz1919. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-01-2008 03:36 AM

    stop the sign event??

     Hi,

    I have got an infopath form with VB code, and i am trying to stop the sign event if a user is not part of a particular role.

    here is my code:

    Public Sub FormEvents_Sign(ByVal sender As Object, ByVal e As SignEventArgs)
                ' This event handler will run only in fully trusted form templates.



                ' To add other pieces of information to sign, modifying the
                ' signature template returned by
                ' thisSignature.SignatureBlockXmlNode.
                ' Write your code here.


                Dim userrole As String = Me.UserRole

                If e.SignedDataBlock.Name = "ICTManagerSignature" Then


                    If userrole = "ICT manager" Then
                        ' Dim thisSignature As Signature = e.SignedDataBlock.Signatures.CreateSignature
                        '  thisSignature.Sign()
                        ' e.SignatureWizard = False
                    Else
                        MessageBox.Show("Only ICT Manager can sign this box", "unable to sign", MessageBoxButtons.OK)

                    End If
                End If         
            End Sub

     

    Notice that the thisSignature.Sign() is commented out, but the form will still continue and allow the user to sign the form??!!

    at first i though it may be a problem with my IF statement that was not working for whatever reason, so i decided to test by commenting out the sign() method. got a shock when it was still able to sign the form.

     

    Any ideas???

     

    Thanks,

     

    Craig.

  • 10-01-2008 03:45 AM In reply to

     please ignore the above, i have sorted it.

    for anyone else with same problem. you need to use the e.signaturewizard = false    to stop the signature dialogue!

     

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.