Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I have a text box with two conditional actions.
The first action (Select in Field) selects a value in the [My Tickets] field if there is currently no selection which works great. The search string is: if(GetSelectedCount([My Tickets])=0,vUserID)
The second action (Clear Field) is supposed to clear the [My Tickets] field if there is a selection. This is NOT working. It clears ALL selections, not just the My Tickets one. The field in the action is set to: if(GetSelectedCount([My Tickets])=1,'[My Tickets]')
Note that the selection is either none or one.
Is there a way to get the "field" to recognize the one field conditionally?
Thanks.
Which version on QV you are using?
In QV 11.2 versions, you have new action Clear Field and use this action to clear one field.
Actions --> Selection --> Clear Field
We are on an earlier version 11 something. But, I do have the Clear Field action. I need to know how to conditionally set the field that I want to be cleared.
You can write expression to get the correct field name. Can you please share in detail requirement and share sample qvw?
Try with getcurrentselections() function to extract the selected Fields.
If you only use the first action, won't this also clear the field if you have actually a selection on that field (ELSE branch executing, empty field value trying to get selected)?
Besides this, I can't reproduce your issue, could you post a small sample QVW?
Sorry, I think I am not being clear in what I am attempting to do.
I am trying to create a toggle button using a text box object. Clicking the button will set the field value to their userid - click it again and it clears the field - click it again and it sets the field value back to the userid - and so forth. It is the toggle action that is causing my issues. I need it to do one action if there are selections already made and a different one if there are no selections already made (see my expressions in the original post). I will try to put together a small sample app, but that will take some time to put together.
The setting the value to userid is working. It is the clearing one that is not working. I think because it doesn't recognize it as the field name, but I could be wrong.
Thanks for you help!
Understood what you are trying to do.
But on my system, it works with the first action only, I think you don't need the second action.
But even if I add the second action, I can't reproduce your issues.
So please post a sample QVW.
Okay. I will try to get something together tomorrow. Thanks again for the assistance. This one really has me stumped.
I have not been able to get a sample application together, yet. But, I did notice one thing this morning. I actually have two toggle buttons. One for "My Tickets" and one for "My Organization". The My Organization one has the same code as My Tickets - just replaces [My Tickets] with [My Organization]. Sorry that I didn't mention that before, but I didn't realize it was important.
If I just click one or the other OFF and ON, then it works perfectly and clears only the one field. However, if I click on "My Tickets" (turn it on) and click on "My Organization" (turn it on), then click on either one to turn it off... THEN it clears all fields.
Thoughts?
Well, I still can't reproduce the issue.
Attached a small sample QVW, trying to do the same as you described in the OP, now for two fields.