Hotel Rooms (Entity?)


Where in the flow are these actions?
Out of context udate room could either be update entity (data) or select entity.
Create Booking Entity is more obvious and would be create entity… Although that might actually be update/change entity with with can create entity as true


Update Room is the 2nd Action listed in the following Rule

Booking Admin - Entity Grid Ask Question - Checkout Room Actions

I have tested every available action and cannot find one with only ‘Constraint’ and ‘Entity Name’ as the available fields.


Constraint is not an action field, it is part of the rule that allows you to constrain individual actions.

Entity name will just be the only field used.
I would have put [:Entity Name] into the action so that the field value can be set within the rule and the acton reused rather than have an action per use.


Thanks for the advice. I have input all the data as per your database (although my eyes are a little tired looking at the screen grabs). This has really helped me understand rules and actions much better.

How should I set up the Bookings Entity.

I currently have it as a Custom Entity screen. pressing the booking Tab does nothing. Do I add Room Entities to this screen or make booking entities.

Now when I select a Room on the POS screen to assign a Room number to a ticket it correctly assigns the Room number to the ticket and products all add ok. However, when I close any ticket the purple screen pops up prompting Payment type. I cannot for the life of me find anyway to execute an automation command from an entity screen.

I can only think I have some setup incorrect in my Entity screens as normally the POS works great with my Room Entities and correctly assigns settlements to Room Accounts (if Sign to Room is selected)

Sorry to be a bit dim but this is pretty new to me and this room account management process looks perfect for my Hotel.


Quick Update on my depressingly slow progress.

I have thought about the Entity Screen for Bookings and have configured it as follows.

Custom Entity Screen with Start Automation Widgets
Widgets Run Automation Command 'RoomEntityGrid"
Button Selects.
Nothing Happens
SambaPos Crashes

I cannot seem to find any problems in the Rules I have input and have tried with Widget value being numeric or string (01 or Room 01) Nothing changes

The only thing I can think of is my configuration of the Automation Command RoomEntityGrid. If I try navigation Settings blank or Entity or Accounts it makes no difference.
Any advice would be greatly received.


Neither of my entity screens were for booking entities.
They were both room entities which recorded the corresponding booking entity name (booking number) as a custom field on the room entity.


Hi Joe

I feel I have now worked a better understanding of the Automation commands but must still have some fundamental lack of knowledge in passing values through rules and actions.

I have finally managed to stop Sambapos crashing when clicking on on a Room entity on the Booking Screen. I feel that I now have a problem assigning the Entity Name as [:CommandValue] in the “Booking Admin - Entity Grid Command Start” Rule below

I have confirmation switched on in the Automation Command to show me where I am in the program but currently it just keeps cycling back to the same confirmation question. obviously the Automation Command “Room EntityGrid” is being called instead of the Automation Command “RoomEntityGridAskQuestions”

Should I have a Value Set in the Automation Cammand (if so what format should that be) and should they be mapped to states or to any particular navigation screens?

I have set the Booking Entity Screen Grid and have the following settings and properties for the Widget

Sorry to bomb you with many screenshots and questions but I feel there is something fundamental I am not understanding or aware of

The Automation command format are all new to me and I have tried numerous selections and syntax but I realise I do not have the necessary knowledge to know if I am correct.

I appreciate the time and effort you have input to date and I am grateful for the personal time you are taking to assist with this.



It’s not getting the entity name from the entity grid by looks of it.
In the grid settings the ommand name triggers the custom rule and the command value if the specific entity selected.
It was a while ago but do you not use a printer tag type expression on the entity grid command value field?


I have tried a number for formats on the entity grid command field value using [ < etc. Must admit I do not know what a printer tag type expression is but I will look it up and give it a try.



The printer tag for entity name is {ENTITY NAME}


Thanks for that.

Still acting the same but I realise I have nowhere set to store some values namely EntityGridBookingNumber. Should I set a Custom Data Field in the Rooms Entity for these?


These are my room custom fields;

And these my booking entity fields;


That main create rule has a flow of;

Load Room Entity
Update Room
Update Room Entity Guest Name Field
Update Room Entity Booking number field
Update Room Entity account field using those values
Update Room Entity checked in field
Update Room Entity field to Occupied
Create booking entity using the room booking number field
Update booking entity guest name field using room field
Update booking entity Checked in field using date
Update booking entity status field using inhouse
Refresh widget


This is so helpful.thank you for the tremendous assistance.

Tomorrow I can have a really good chance of getting this up and running and understanding a lot more about the SambaPos processes.



Hi Joe

I have done all the Custom Fields but I cannot test any of them as I cannot get past the First Automation Command (RoomEntityGrid). I switched on confirmation on the automation command just to check it was running.
I also added some test message Actions in the rule Booking Admin - Entity Grid Command Start with a button name [:CommandValue]. This runs and gives me a message showing the Room number. This tells me the CommandValue is being correctly passed from the Entity to the Command Flow.

At this point the flow should execute EntityGridAskQuestions but it loops back to the beginning and runs the RoomEntityGrid again.

I have tried all combinations of Execute once and Clear Value in the original Automation Command and cannot get any different behavior.

If I could just get EntityGridAskQuestions to execute I think I could get this working. I have double checked and reentered Actions and Rules many times to ensure they match your screenshots but they all appear correct.


This is the first rule from the entity grid;

Show me yours?


here it is

Sorry can only do it in screenshots.
It includes my test message screen to track progress


You have a space in the booking balance program setting name but dont thing that will be causing what your describing…

Am just trying to refresh myself in the flow of this setup.
This rule is purely logging the entity data to program settings depending on the status.
ie. if its occupied log the booking number and balance to program settings ready for use in the ask questions rule…
So show your ask questions rule?


This is my ask questions rule - sorry the constraints are cropped…

It is basicly checking 3 things and triggering another rule as part of an ask question prompt.
The three ask questions relate to;

  1. Room not occupied
  2. Room occupied with an outstanding balance
  3. Room occupied with 0 balance

This were the constraints

  1. '{REPORT ENTITY DETAIL:EC.Room Status:(EN=[:CommandValue])}' != 'Occupied'

  2. '{REPORT ENTITY DETAIL:EC.Room Status:(EN=[:CommandValue])}' == 'Occupied' && '{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}' != '' && '{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}' != '0.00'

  3. '{REPORT ENTITY DETAIL:EC.Room Status:(EN=[:CommandValue])}' == 'Occupied' && ('{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}' == '' || '{CALL:accountinfo.BalanceFromEntityGridBookingNumberSetting()}' == '0.00')

This is the script used in them;

function accountbalance(accountname)
var qry = "\
sum([Debit])-sum([Credit]) as [Balance] \
FROM [dbo].[AccountTransactionValues] tv \
LEFT JOIN [Accounts] a ON a.[Id] = tv.[AccountId] \
LEFT JOIN [Entities] e ON e.[AccountId] = a.[Id] \
WHERE 1=1 \
AND a.[Name] = '"+accountname+"'";

var balance = sql.Query(qry).First;
return balance;

function BalanceFromEntityGridBookingNumberSetting()
  var qry1 = "SELECT [Value] FROM [ProgramSettingValues] WHERE [Name]='"+'EntityGridBookingNumber'+"'";
  var accountname = sql.Query(qry1).First;
  var qry2 = "\
  sum([Debit])-sum([Credit]) as [Balance] \
  FROM [dbo].[AccountTransactionValues] tv \
  LEFT JOIN [Accounts] a ON a.[Id] = tv.[AccountId] \
  LEFT JOIN [Entities] e ON e.[AccountId] = a.[Id] \
  WHERE 1=1 \
  AND a.[Name] = '"+accountname+"'";

  var balance = sql.Query(qry2).First;
  return balance;


Thanks for the full constraints and the script (by the way do I define the Handler for this script and if so what should this be)

Well the problem is definitely in the EntityGridCommandStart Rule namely in the Generic Execute Automation Command Action. I just does not execute the RoomEntityGridAskQuestions Action. I tested this by directly executing the AskQuestions rule from the Entity Grid and it gave me the purple screen telling me the “Room is Vacant Do you want to create a booking?” question. Obviously the Values had not been set but it did prove the Rule runs.

I am rebuilding the CommandStart Action to see if my glitch is there.