Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Keep a Field Locked

Hi all,

I would like to force a field property to be locked regardless the Unlock or Unlock All actions are used.

I was trying to find on some of the standard document properties or actions something that could have that effect but didn't succeed.

I did go through the API Guide, and there are some macro examples - onUnlockActionitems, CanUnlock that with the proper changes might provide the desired result - to remember: a field is locked by action when document opens and I want it to keep that locked status during all user session regardless someone press Lock/Unlock buttons.

If this can't be achieved is it feasible to just de-activate the Lock / Unlock functions for the entire document?

Thank you very much for your help

Regards

Joao

1 Solution

Accepted Solutions
Not applicable
Author

The macro is pretty straightforward.

Sub Lock
ActiveDocument.Fields("FIELDNAME").Lock
End Sub


As footsie said, put this in the UnLock event of your field.

View solution in original post

4 Replies
Not applicable
Author

Hi Indiana,

The only method I can think of is field specific and requires a macro. You might want to keep more than one field locked. Basically what you can do is create a macro to lock the field(s) in question. On the unlock event for the field call your macro to lock it. You could possibly use an action if you are using Qlikview 9. I am using 8.5 on site today so cannot test on 9 until later today.

Kind Regards

Footsie

Not applicable
Author

Hi Footsie,

Thanks for your reply.

Understood your suggestion which goes in direction I've searched.

Is it possible for you to design the macro as I'm not familar with vbscript?

Appreciate all your help

Regards

Joao

Not applicable
Author

The macro is pretty straightforward.

Sub Lock
ActiveDocument.Fields("FIELDNAME").Lock
End Sub


As footsie said, put this in the UnLock event of your field.

Not applicable
Author

Hi NMiller, Footsie

It's solved thanks to you both.

In fact there's no need for the macro. Just define the OnUnlock event over the field of interest and then set the action for a Lock.

Again thank very much

Regards

Joao