Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Unlock and Clear All???

Hi all

I hope somebody can help.

I have created a document that makes some selections onOpen and locks the fields. I do not want anybody to be able to unlock these fields.

However the "Unlock and Clear All" option gives them the option to do this.

Question is can this option be disable/removed or trigger an event???

I have searched the community and found a suggestion that suggested adding a "Back" and "Lock field" in the onChange event, however this doesn't work when the  "Unlock and Clear All" option is clicked.

I have tried a macro, but the  "Unlock and Clear All" option doesn't generate a trigger event???

I am sure somebody must have created a document that makes pre selections that they don't want to be cleared, but how do you disable or trigger an event when "Unlock and Clear All" option is clicked.

I have tried both QV9 and QV11.

HELP!!!!

2 Replies
Not applicable
Author

I think you should be able to do this by simply adding two Document Event Triggers.  Go settings->document properties->triggers tab then edit OnAnySelect and the actions for it.  Then click add and select 'Back' from the right.  Click add again and select 'Lock Field' and then type in the name of the field you wish to lock.  When I test it on here when you try and select unlock and clear all it doesn't change anything when I have previously locked a field.  Let me know if this works for you.

Of course, this also makes it so that you can't really make any other selections...

Hope this helps.

Not applicable
Author

I think a better solution is actually this.

In your macro do this:

sub semilock

     ActiveDocument.Fields("FieldName").Select "LockedField"

     ActiveDocument.Fields("FieldName").Lock

end sub

Then attach this macro to OnAnySelect under document properties->triggers, by doing edit actions, add External -> Run Macro.  Then type in the Macro name as semiLock.

Now you just have to specify what fields you want permanently locked in the macro, and everytime someone tries to unlock and clear all, it will keep the current selection selected and locked.