[ANSWERED] Entity Screens: Possible to show specific screen only on login?

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.

Here is a quick tutorial.

Here are my users. Emre, Q and JS’s user role are Waiter

I’ll create an Update Program Setting action.

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.

It will display Clock in and Clock out buttons. When Clock in clicked it will execute automation command named X and Y for Clock out button.

Now we’ll create a user logged in rule.

It sets user’s TC status to 1 and displays popup if user’s TC status is not 1. So all users will see popup once as they log in.

You can view database to see how they stored.

Now we need to reset these settings back to 0 to display them popup again when they login. We’ll use Value Looper action to create a loop.

When that action executes it will trigger Value Looped rule for each value separated with commas.

We’ll handle that with…

So when we execute Reset User's TC Status action all users TC values should be 0. We can do it when work period ends.

When I end work period values becomes…

In fact it does nothing useful atm but I hope it demonstrates the idea.

3 Likes

That sounds perfect. Cant wait to try it.

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.

1 Like

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.

Here is my sdf file. It resets on work period end and seems working fine for me.

data50.zip (111.6 KB)

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]}

Can’t figure out why yours put SETTING in there and what that means.

I love this concept for what I am trying to do if I can get it to work.

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.

PS:I’ve changed tutorial screenshot.

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.

The sample works only for Waiter user role. Did you corrected this too?

Oh so it would not work for Admin role? That could be why then. Let me try

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.

Can you PM me a zip file that contains your current backup ?

Just sent you the backup. The filename has wrong date but it is a fresh backup.