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: 
keithlawrence
Contributor III
Contributor III

Triggers / locked field / clear

I'm having difficulty with triggers and need some help.

I have a trigger on a field (let's call it Field 1) that sets various variables. That field is locked but when Clear is selected, it performs the triggers as if the field is blank.

For example

Field 1 = 'Yes' (Locked)

Actions behind Field 1 are set to:

Set Variable

Variable = vVariable1

Value = If(GetSelectedCount([Field 1])=0,0,1)

This is on both OnSelect and OnChange.

Even if Field 1 is locked with a selection the variable is set to 0 when it should be a 1.

Why is this happening and how can I stop it?

5 Replies
manoj217
Creator III
Creator III

Hi keith,

order is also important for the actions.

if you set your prefference Value = If(GetSelectedCount([Field 1])=0,0,1) this condition as first means it wil perform the first

2nd preference is lock filed means it will perform 2nd so make sure set the actions like your requirement

keithlawrence
Contributor III
Contributor III
Author

Hi Manjo,

Thanks. The lock action is not part of the trigger as this is already in place before clear has been selected.

The event trigger purely sets variables.

I don't understand why the field is being seen as clear when the lock is in place with a selection prior to the clear being pressed.

rwunderlich
Partner Ambassador/MVP
Partner Ambassador/MVP

Can you upload a qvw example?

-Rob

keithlawrence
Contributor III
Contributor III
Author

Due to the sensitivity of the document, I can't. The file size is also 4GB so wouldn't upload.

I've tried to recreate it in a blank QVW but it's not reacting in the same way. It's very strange why it's behaving this way

keithlawrence
Contributor III
Contributor III
Author

The source of this appears to an alternative state.

When there is no alternative state, the behaviour works correctly. When an alternative state is present, it breaks.

Even if I have the triggers set to only work on <default state> it does not work. Not sure how I can get this fixed without taking the alternative state out of my app.