@QMcKay State value should also be in quotes.
Thanks @emre - that seems to work.
I’m trying to figure a way to only Log PunchIn
and PunchOut
while still updating State
(colors) between the following:
PunchIn
PunchOut
PunchBreak
PunchLunch
PunchWhatever
Because honestly I don’t care about logging Break or Lunch… PunchIn
and PunchOut
are the only ones important enough to Log.
Tomorrow is another day…
@QMcKay What if you tell it what State is start and what state is end… so it only looks for those states… instead of [:StateStart] do PunchIn
Ooh check these bad boys out.
{REPORT ENTITY STATE DETAILS:X} Entity State Details
{REPORT ENTITY STATE TOTAL DURATION:X} Entity State Total Duration
{REPORT ENTITY STATE TOTAL HOURS:X} Entity State Total Hours
{REPORT ENTITY STATE TOTAL MINUTES:X} Entity State Total Minutes
{REPORT ENTITY STATE TOTAL SECONDS:X} Entity State Total Seconds
{ENTITY STATE ENTITY LIST:X} Entity State Log Entity Names
{ENTITY STATE START DATE LIST:X} Entity State Log Start Dates
{ENTITY STATE END DATE LIST:X} Entity State Log End Dates
EDIT: I cannot seem to get these to work… @QMcKay any luck? Most of them crash… ive had a few attempts not crash but nothing reports.
Guess I will wait to see the values for X
That’s what I was thinking. But it doesn’t quite work that way… I thought maybe it would pull the EndDate from the 2nd row and make it the StartDate in the first row (note: records are sorted to show most recent first)
Hmmm… I wonder now about maybe I could try setting Async
to False ?
EDIT: I’ve also been wondering how it knows to set StartState
to PunchOut in the Log when you Clock In for the first time?
EDIT: I give up on that for now (I won’t be using Break/Lunch States anyway, so I removed those choices - I was just trying to get a handle on how the Logging worked)
If it is not important you can keep in/out and create a separate state flow for break & lunch statuses.
My simple TimeClock Implementation - it is not tied to Users or Logins and does not require PIN:
For @QMcKay, @Jesse and other people who installed test releases…
Please check EntityStateLogs
table and if that foreign key and index does not exists create them for better performance and stability.
ALTER TABLE [EntityStateLogs] ADD CONSTRAINT [FK_dbo.EntityStateLogs_dbo.Entities_EntityId] FOREIGN KEY ([EntityId]) REFERENCES [Entities] ([Id]) ON DELETE CASCADE
and
CREATE NONCLUSTERED INDEX [IX_EntityId] ON [EntityStateLogs]([EntityId] ASC)
What I am missing here???
I cannot keep up… please SLOW DOWN!!!
G.
@emre, you’re probably in the middle of writing a Tutorial that explains this; if so, feel free to ignore me…
Can you elaborate on what this function actually does? Log Entity State
-
what does the
Async
True/False option do? -
DISREGARD THIS QUESTION… Answer: No.
[EntityStateValues]
contains last known State and Date/Time. I have a suspicion that it does not just log what you tell it to, instead it reads the last known State[EndState]
from the Log based onMAX([EndStateDate])
first, then performs the Logging write as requested. Is this True? -
DISREGARD THIS QUESTION… Answer:
[EntityStateValues]
contains last known State and Date/Time. If there is no Log Data (table[EntityStateLogs]
is empty), and (presumably) the Entity is ‘Stateless’ (i.e. immediately after application launch), how does it know what to write into[StartState]
? For me in this case, it seems to magically write PunchOut which is perfect, but how does it decide to do that?
I just posted a link for the Database Tools import file for my Time Clock implementation. Few things you need to do and will be explained in more detail in the tutorial… Create your Employee entities … create users with same name… enter the same pin for both the entities and the users.
Can’t wait for official time clock release!
It should have button in the main screen with Work Period, POS…right.
Personally I don’t like using the main screen for said function.
Or make Automation Button at the main entity screen
I have a system that sort of answers that I am about to make it live.
I think this is as “official” as it’s going to get for the next while. The added feature (Log Entity State
) has allowed us to build a basic TimeClock, but the feature can also be used for many other things (i.e. tracking table usage)… My guess is that is the primary reason for this feature addition, because it is not specific to TimeClock. I think we’ll be waiting a long while for an “official” TimeClock…
That said, this feature is very powerful, and can be used to build a very decent TimeClock Implementation, immediately. How you do it is up to you.
@Jesse, in his implementation, links Employee Entities
to Users
and the Login/Logout
mechanism, while my posted implementation is very basic to show minimum requirements to implement it…
Another cool thing this might open up is the Order State tracking. You can track average time for an order to hit the kitchen vs Ready… You can track delivery times… all sorts of really cool things. This will enhance Kitchen screens…
EDIT: Sorry I jumped the gun Order State Logging is not currently available.
While I did mention the design could have been made for any type of State, that’s not what we have here. It is specific to Entities [EntityStateLogs]… it won’t log Ticket or Order States, however…
So it sounds like @emre could do some copy/paste of code to implement it for Ticket and Order withou too much hassle.
Yeah sorry I got ahead of myself. You are correct it is not ready for that yet. I tried to say in the future… when I said “might open up” I just used bad wording.