I don’t think its currently possible and if not I would like to request it. I will use my example for better understanding.
I need Samba to behave in such a way that when a user first logs in it will only show my “Time Clock” entity screen for them to clock in. Once they have clocked in via command button it will open up and show them the rest of the screens I have mapped to them.
If they log out they may not be clocking out they may just be doing something else or letting a different user log in to use the terminal. So when they log-in again in the same work period I want it to show all the assigned menus as normal.
Finally when I close Work Period I want it to reset so next work period the user’s first log-in only shows the “Time Clock” Entity screen and it repeats the behavior I described above.
Or perhaps… I am not knowledgeable enough of how to use it… I noticed an action that can display a popup. Can I program an action that shows my Clock In and Clock Out command buttons in the popup then use rules to make it only run on users first log in for the work period and not on any subsequent log ins within same work period.
I think @QMcKay suggested it before but in case of you’ve missed it you can store each user’s time clock state as a program setting. I’ve updated few features to read current user name and role better for next version. I’m planning to upload it shortly so we can continue discussing that after releasing it.
Think program settings are custom values stored in database or local memory. This action will create a setting by user name prefixed with TC_. Setting IsLocal parameter to false means it will stored in database and available to all terminals.
I’ll create an action to display TC Command buttons.
That will be perfect if eventually I can map that process to show specific entity screens on log in. Maybe an action that can be mapped to the process you just demonstrated that would “Show Entity Screen” [:Entity Screen] {Screen 1} or {Screen_1, Screen_2} something like that.
It could still work as it does today but if that action is invoked it would only show the screens specified by the action. That way if people do not wish to use the functionality like this it would not change anything for them.
Thinking about it deeper… A behavior like you demonstrated could be useful for way more than just what I am trying to do. It definitely makes it more flexible.
I ran this just a few minutes ago and it worked once… it reset it to 0. But now even though the value is reset at 0 the rule will not run to display popup again. It only worked once. I looked over all of the rules/actions to make sure I didnt make a mistake and I didnt. The logic is correct too. So why is it not running the Display Popup rule again if the value is indeed 0.
It is resetting just fine. I looked at my DB and it reset to 0. Problem is it will not show popup anymore. It worked the very first time I ran it. It seems the Display Popup Rule is not working for some reason. I just checked my setup again to be absolutely sure and it is setup 100% correct.
The only difference in the db i see is with the display popup rule. Mine is set exactly like yours in the tutorial… but in the table yours says "L":"{SETTING:TC_[:UserName]} Mine says "L":"{:TC_[:UserName]}
OK I’ve forgot to update screen shot sorry. You should use SETTING printer tag because {:X} shortcut works before updating [:UserName] value. So Sambapos searches for TC_[:UserName] setting name instead of TC_Admin.
Still not working. I have looked at every rule and action in my db and compared to yours it matches exactly now. But still will not bring the popup back up.
Still will not work. It worked the very first time and it did reset value to 0 but it will not bring up the question popup again. So something is not working with the Constraint for reading the value of 0 I think.