Community

context.Field("xyz").IsVisible doesn't work

Hey everyone 

I wrote script in vba, something like that:

"

Imports System

Imports Microsoft.VisualBasic

Dim testResult As Boolean =context.Field("Save1").value

if testResult <> 0 Then

 

context.Field("Description").IsVisible = false

else

context.Field("Description").IsVisible = true

end if

"

Field "Save1" is type of checkbox. When I checking this box field "Description" is still visible. And my function doesn't work. This work only during first load, processing document OCR. When I verify document  on verification station and check this box this is still visible.

I don't understand why

Do you have any idea? 

Was this article helpful?

0 out of 0 found this helpful

Comments

4 comments

  • Avatar
    Permanently deleted user

    Hello,

    As we understand your requirements, you need to hide fields depending on the checkmark’s state. 

    Field visibility cannot be changed during the stages. To change fields' visibility you may place your script e.g. on the event handler level, Project properties > Event Handlers Tab "After document state changed" event would be a good place for it, where ChangedStates.Has(2) (2 is for "Recognized").

    Please note, that in such scripts fields' names should be used in FullName format (like "Document Section 1\Checkmark1")

     

    To get more information, please check the following topic if ABBYY FlexiCapture 11 Developer's Help: 

    Appendix > Using scripts in ABBYY FlexiCapture > Scripts for customizing processing stages > Types of scripts > Event handlers > Document state changed

    0
  • Avatar
    Permanently deleted user

    Hello Ekteina, I took your advice.

    And try yo use script like this:

    Dim testResult

    testResult = me.Field("Doc\TYPE").value

    if testResult = "AFERTA" and ChangedStates.Has(2) Then

    Me.Field("Doc\FAXDOG").IsVisible = false

    end if

     

    But it's not working for me((

    Can you help?

    0
  • Avatar
    Permanently deleted user

    Hello,

    Please send us more details how exactly you script does not work. It will be great to see the screenshot..

    0
  • Avatar
    Ranjit Nayak

    I am trying to do same in Document Definition level, want to hide some fields and want to block from export. Any suggestions please.

    0

Please sign in to leave a comment.