Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Can I disable user unlock a locked field in QV?

Hi,  I have a locked field for somepurpose which don't want user unlock it, could I?

5 Replies
erichshiino
Partner - Master
Partner - Master

Hi,

I've locked the field and included triggers (must be in this order)

On the field, onUnlock event I include lock (so, when it's unlocked I lock it back!)

The problem was that the user could use the clear button with the option with the option 'Unlock and Clear'

Then, on the same field I included on the OnSelet Action:

1 - Back (so I go back to the point before the clear button - this will lock my field back too)

2 - Clear (since my field is locked and the user tried to clear, I use a clear, protecting the locked field)

Please, check attachment. Tell me if it's possible to unlock it somehow ( of course, you can remove the trigger, but this would not be possible on a client - server environment)

Hope it works in your case

Erich

Not applicable
Author


Hi, how can you lock the field when document opened in the first time.?

Your sample is good. But I want to add it to my formal qvw which has a trigger when document opened the field is selected. But it doen't work, it seems these two triggers are not work well together.

erichshiino
Partner - Master
Partner - Master

Hi, it took some time and some help from Rakesh here:

http://community.qlik.com/message/118015#118015

The following sub can recreate the actions I put on the field on my first attachment.

So, whatever you need you can just execute and after you just call this:

It plays with the field TEAM. I see that i can be optimized but I works

sub addAction

    set fld=ActiveDocument.GetField("TEAM")

    set fp = fld.GetProperties

    set actions=fp.OnSelectActionItems

    ACTIONs.ADD

    actions.item(0).type = 6

    ACTIONs.ADD

    actions.item(1).type = 4

    'for i=0 to actions.Count-1

    ' msgbox "Action types: " & actions.item(i).Type

    'next

    fld.setproperties fp

   

    set fld2=ActiveDocument.GetField("TEAM")

    set fp2 = fld2.GetProperties

    set actions2=fp2.OnUnlockActionItems

    ACTIONs2.ADD

    actions2.item(0).type = 6

    ACTIONs2.ADD

    actions2.item(1).type = 28

    'for i=0 to actions.Count-1

    ' msgbox "Action types: " & actions.item(i).Type

    'next

    fld2.setproperties fp2

   

    fld2.lock

end sub

Regards,

Erich

Not applicable
Author

Nice little VBA block -- So, if you deploy that on a server, and then to an iPad, does it work?

erichshiino
Partner - Master
Partner - Master

Hi, for the fist sample app, I only used action so it should more all right.

For the second one, I would need the onOpen trigger and some macros, then I'm not so sure if it would work.

I'd like to know if there would be a difference for macro behaviors in iPad client and QV running on ajax on safari browsers.

If you are able to try it, please let me know the results.

Regards,

Erich