Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Lock some fields containing a word

Hi,

I'm trying to lock all the fields containing a word 'TEST'.

For example i want at the open of the document, lock the fields abcTEST, abcTESTde, ...

As there are a lot of fields, i would like to know an alternative to lock every field ono per one in parameter->document parameter on tab trigger

thanks

3 Replies
flipside
Partner - Specialist II
Partner - Specialist II

Have you tried setting up a bookmark with include layout state and applying that on a trigger instead.

flipside

Not applicable
Author

Aren't there a way to loop on all the fields in VB script and ook if the field contain 'TEST' for finally lock the fields

thanks

Not applicable
Author

I found a solution with a macro that i shoot at the open of the document.

Here is the macro

sub lockCCAFields

set flddescs = ActiveDocument.GetFieldDescriptions

for i = 0 to flddescs.count() -1

    fdesc = flddescs(i)

   

    if InStr(1,fdesc.Name,"TEST")>0 then

        ActiveDocument.getField(fdesc.Name).Lock

    end if

next

end sub