Had a call from client who said he started up a bar tab today and it kept popping up every time he used the tills. So he had to cash it off and manually tab up for the customer.
So I decided to think about this myself rather than ask, but upon changing things I got behaviour which was wrong.
Tutorials used were
and
The Switch user uses [:UserName] and bartab function closes it with the username too. So when a bartab is created and closed… all is good until you go to open a new ticket.
What I tried to do was add an action to the BarTabs to create an entity state of ‘BarTab’ when its set as a bar tab and for the Switch User to only bring up the order if ‘{ENTITY NAME:BarTab} is NULL’ but this doesn’t seem to work?
Try using your entity table constraint but instead of being is. NULL You could use not matches and then add your table numbers separated by a pipe, for example
{ENTITY NAME:Table} not matches 1|2|3|4
Bit of a ball ache listing all your tables but see if that works, if it does theres probably a way to do it without listing them all
Try it with just one table number first to see if the constraint works, then create a ticket using that table number and see if the switch user now works
Put a Show Message Action in the Rule to see if it is firing and put {ENTITY NAME:Customers} (with ‘s’) and {ENTITY NAME:Customer} (no ‘s’) in the message.
I am also confused as to why you have an Action named SU_Switch User button in your Rule. What does it do? Is it calling the same Automation Command Name that the Rule is for? If so, you could case an infinite loop if your Rule Constraints are not carefully planned and met.
Tried it with just Table 1 and it still logs into the user and shows the table.
Tried with ENTITY not matches/equals and it does the same.
When I settle a ticket it opens the settled ticket and wont let me out of the screen till I press close, when I log back in it takes me to the settled ticket again, stuck loop. Happens on both instances above.
Rule is firing because it works with the bar tab constraint within the rule I have running works perfectly. The SU_Switch User Action is a log out action, I have changed the name to reflect this and avoid confusion.
Its only a small village pub, If I cant get this working then ill just scrap the Tables and use Bar Tab only. If they never had it they never knew it existed right?
So first of all, either the plural or non-plural version both work, which is expected. But it has been mentioned previously to prefer the plural version since it is theoretically faster. Use {ENTITY NAME:Tables} whenever possible.
The overall Rule should be set to Execute when Matches or Matches All
I still don’t understand this. Your Rule has 3 Actions:
SU_Switch User button
Close Ticket
SU_Logout
It appears you have a Logout action in there as the 3rd action. If the 1st action is also a Logout action, then you need to place it after the Close Ticket action.
Maybe post a revised screenshot with your actions expanded. Also post screenshots of all the individual Action definitions being used in the Rule.