Try this, I haven't tested this...
Go to Layout ( ... ) // important to set context, even if not really needed, as a precaution
Go to Record/Request/Page ( Previous )
Set Variable ( $ CreationDateLastRecord; Value: TableOne :: CreationDateField )
Go to Record/Request/Page ( Next )
# what's missing here is a test for when the year rolls over
If ( DayOfYear ( Get ( Current Date ) ) > DayOfYear ( $ CreationDateLastRecord )
Set Field ( TableOne :: giveUsOurDailyCount ; 1 ) // "1" is our calculated result that we specify in ScriptMaker
Set Variable ( $ DailyCount; Value: 1 )
Set Variable ( $ DailyCount; Value: $ DailyCount = $ DailyCount + 1 )
Set Field ( TableOne :: giveUsOurDailyCount ; $ DailyCount )
I created this script changing the parts that were table::field specific. I also changed the current date to a field in my table called delivery date. As delivery date and current date are never the same due to lazy employees :) The bottom line is the script looks like it goes into a infinite loop.
Perhaps I made some assumptions, I assumed I should trigger this script on object enter into the transaction per day field of the data entry layout that I created.
After the infinite looping event, I decided to use your original suggestion using the Get (Current Date) function it also went into a infinite loop.
I learned quite a bit on how to use many of these functions, syntax and the tyrannical script editting GUI.
I did some searching on the internet and I found a better description w/ examples for the Filemaker functions. From this work I developed the answer that worked. All I needed to do was create a counter field in the table set as a calculation:If ( GetNthRecord ( Delivery Date;Get ( RecordNumber )) = GetNthRecord (Delivery Date; Get( RecordNumber ) - 1 ) ; GetNthRecord ( DATE DUMP COUNTER 2;Get ( RecordNumber ) - 1 ) + 1; 1 )This counter is dependent on the order of records being added, but this is the reason I created it so that the data entry people don't have to populate the field. Filemaker has a target rich environment for enhancements to the Summary Count function.Lars,PS. I showed my mom the solution and she said, I was very bright. She's the bestest.
I am not your mother, so let me point out two things:
GetNthRecord ( Delivery Date ; Get ( RecordNumber ) )
is a V E R Y elaborate way to say the same thing as:
Your method has good chances of producing duplicate numbers in a multi-user environment. If two users are creating a new record at roughly the same time, they do not "see" each other's effort until they commit their records - and then it's too late.
You should also consider what happens when a record is deleted, or when user enters the wrong date by mistake and needs to correct it, and so on.
1) I use the extra qualifiers b/c I am the kind of guy that wears suspenders and a belt, I dont take chances; plus I wanted to draw out any lurkers that are smart enough to comment but too shy to help on the original post, Go YOU!
2) Only have one data entry person and I have an override system set up. Thanks for the critique, I also created a system to check for voids. I may be hiring a QA person in the future. LOL
PS. This forum is great for fixing the easy answers that can be easily found by RTFM.