Get ( CurrentDate ) with Calcs

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Get ( CurrentDate ) with Calcs

dealtek@gmail.com
Hi all,

On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date

Then you could perform calculations (like days overdue etc.) related to "today's date" from that field


Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )


--
Thanks,
Dave - DealTek
[hidden email]
[db-17]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

Ben Levitan LLC
Got to be unstored and updated.



Ben
sent from my IBM Selectric Typewriter
____________________________________________________




-----Original Message-----
From: dealtek <[hidden email]>
To: Filemaker Experts <[hidden email]>
Sent: Wed, Mar 29, 2017 5:32 pm
Subject: Get ( CurrentDate ) with Calcs

Hi all,

On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date

Then you could perform calculations (like days overdue etc.) related to "today's date" from that field


Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )


--
Thanks,
Dave - DealTek
[hidden email]
[db-17]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

RE: Get ( CurrentDate ) with Calcs

Jonn Howell at DataExperience
In reply to this post by dealtek@gmail.com
Dave,

If you are referring to the "Today" function....don't use it!

If the system is on a FileMaker Server, always best to use GetasDate ( Get (
CurrentHostTimestamp ) ).
Else, use Get ( CurrentDate ).

Thanks,

Jonn


Jonn Howell
DataExperience, Inc.
Certified FileMaker Developer
dba Bootcamp for FileMaker
[hidden email]
www.dataexperience.com
www.youtube.com/dataexperience
805-368-4748




-----Original Message-----
From: FMPexperts [mailto:[hidden email]] On Behalf
Of [hidden email]
Sent: Wednesday, March 29, 2017 2:26 PM
To: Filemaker Experts
Subject: Get ( CurrentDate ) with Calcs

Hi all,

On previous FileMaker versions sometimes we would write a server script that
ran every night and updated a date field with the current date

Then you could perform calculations (like days overdue etc.) related to
"today's date" from that field


Q: Do we still need to do this or can we just create calc fields that use
... Get ( CurrentDate )


--
Thanks,
Dave - DealTek
[hidden email]
[db-17]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

Tom Fitch
Depends what your needs are. You may still want to script the update
for performance reasons.

Tom Fitch
FileMaker Pro Certified Developer
Portland, Oregon



> -----Original Message-----
> From: FMPexperts [mailto:[hidden email]] On Behalf
> Of [hidden email]
> Sent: Wednesday, March 29, 2017 2:26 PM
> To: Filemaker Experts
> Subject: Get ( CurrentDate ) with Calcs
>
> Hi all,
>
> On previous FileMaker versions sometimes we would write a server script that
> ran every night and updated a date field with the current date
>
> Then you could perform calculations (like days overdue etc.) related to
> "today's date" from that field
>
>
> Q: Do we still need to do this or can we just create calc fields that use
> ... Get ( CurrentDate )
_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

Richard DeShong
In reply to this post by dealtek@gmail.com
Hi Dave,

This rule has not changed:  If you have a calc field that requires data
from outside the current record, then you need a trigger to update it.

For an accounting system, you should not rely on an auto-calc to perform
aging.  You should create a script that reviews each invoice/statement
and produces a report.

For other types of daily/hourly/etc aging, stick with the server-side
script.


On 3/29/2017 2:26 PM, [hidden email] wrote:

> Hi all,
>
> On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date
>
> Then you could perform calculations (like days overdue etc.) related to "today's date" from that field
>
>
> Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )
>
>
> --
> Thanks,
> Dave - DealTek
> [hidden email]
> [db-17]
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

--
Richard DeShong
Logic Tools
510-642-5123 office
925-285-1088 cell

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

dealtek@gmail.com
Thanks so much for the info.

Just so I am clear - if I want to do aging - then setting a number calc field like this:

Get ( CurrentDate ) - invoice date

is not best?

-  better to run a nightly server script - that finds invoices and fills a number field with that calc?


Thanks John - no I was not talking of this old function - sorry if I was confusing
> If you are referring to the "Today" function....don't use it!



Dave



> On Mar 29, 2017, at 3:31 PM, Richard DeShong <[hidden email]> wrote:
>
> Hi Dave,
>
> This rule has not changed:  If you have a calc field that requires data from outside the current record, then you need a trigger to update it.
>
> For an accounting system, you should not rely on an auto-calc to perform aging.  You should create a script that reviews each invoice/statement and produces a report.
>
> For other types of daily/hourly/etc aging, stick with the server-side script.
>
>
> On 3/29/2017 2:26 PM, [hidden email] wrote:
>> Hi all,
>>
>> On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date
>>
>> Then you could perform calculations (like days overdue etc.) related to "today's date" from that field
>>
>>
>> Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )
>>
>>
>> --
>> Thanks,
>> Dave - DealTek
>> [hidden email]
>> [db-17]
>>
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> --
> Richard DeShong
> Logic Tools
> 510-642-5123 office
> 925-285-1088 cell
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


--
Thanks,
Dave - DealTek
[hidden email]
[db-17]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

Richard DeShong
If you have a calc field with the formula:

Get( CurrentDate ) - invoice date

Then the data in that field will not be accurate unless you "trigger"
the calculation.  A trigger can be a number of operations:  1) find and
display that record on a layout with that calc field;  or  2) set the
invoice date field (to a new date or to itself).  There a number of
sources that describe FM's calc process (created by the generous people
on this list).

The important thing to note is this:
1) If the calc uses only data from the current record, it will be
accurate (or as accurate as that other data is);
2) If it uses a function or related data, then it should not be trusted
in a Find().

I would be interested to know why invoices would need to be aged on a
daily basis (maybe to send reminder notices?).  In any case, if "you"
are going to tell a customer that they owe you money, and specify how
"old" this debt is, then I suggest you include that calculation in the
script to send the notices.  That is, find all open invoices, loop
through them, calculated their age and keeping those that interest you.  
Then send your notices and produce a nice report with the details of the
process.  What business manager/accountant wouldn't want that?


On 3/29/2017 4:05 PM, [hidden email] wrote:

> Thanks so much for the info.
>
> Just so I am clear - if I want to do aging - then setting a number calc field like this:
>
> Get ( CurrentDate ) - invoice date
>
> is not best?
>
> -  better to run a nightly server script - that finds invoices and fills a number field with that calc?
>
>
> Thanks John - no I was not talking of this old function - sorry if I was confusing
>> If you are referring to the "Today" function....don't use it!
>
>
> Dave
>
>
>
>> On Mar 29, 2017, at 3:31 PM, Richard DeShong <[hidden email]> wrote:
>>
>> Hi Dave,
>>
>> This rule has not changed:  If you have a calc field that requires data from outside the current record, then you need a trigger to update it.
>>
>> For an accounting system, you should not rely on an auto-calc to perform aging.  You should create a script that reviews each invoice/statement and produces a report.
>>
>> For other types of daily/hourly/etc aging, stick with the server-side script.
>>
>>
>> On 3/29/2017 2:26 PM, [hidden email] wrote:
>>> Hi all,
>>>
>>> On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date
>>>
>>> Then you could perform calculations (like days overdue etc.) related to "today's date" from that field
>>>
>>>
>>> Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )
>>>
>>>
>>> --
>>> Thanks,
>>> Dave - DealTek
>>> [hidden email]
>>> [db-17]
>>>
>>> _______________________________________________
>>> FMPexperts mailing list
>>> [hidden email]
>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>> --
>> Richard DeShong
>> Logic Tools
>> 510-642-5123 office
>> 925-285-1088 cell
>>
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> --
> Thanks,
> Dave - DealTek
> [hidden email]
> [db-17]
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

--
Richard DeShong
Logic Tools
510-642-5123 office
925-285-1088 cell

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

dealtek@gmail.com

> On Mar 29, 2017, at 5:18 PM, Richard DeShong <[hidden email]> wrote:
>
> If you have a calc field with the formula:
>
> Get( CurrentDate ) - invoice date
>
> Then the data in that field will not be accurate unless you "trigger" the calculation.  A trigger can be a number of operations:  1) find and display that record on a layout with that calc field;  or  2) set the invoice date field (to a new date or to itself).  There a number of sources that describe FM's calc process (created by the generous people on this list).
>
> The important thing to note is this:
> 1) If the calc uses only data from the current record, it will be accurate (or as accurate as that other data is);
> 2) If it uses a function or related data, then it should not be trusted in a Find().
>
> I would be interested to know why invoices would need to be aged on a daily basis (maybe to send reminder notices?).  In any case, if "you" are going to tell a customer that they owe you money, and specify how "old" this debt is, then I suggest you include that calculation in the script to send the notices.  That is, find all open invoices, loop through them, calculated their age and keeping those that interest you.  Then send your notices and produce a nice report with the details of the process.  What business manager/accountant wouldn't want that?
>
>

Thanks for all these great clear details Richard!

Dave





> On 3/29/2017 4:05 PM, [hidden email] wrote:
>> Thanks so much for the info.
>>
>> Just so I am clear - if I want to do aging - then setting a number calc field like this:
>>
>> Get ( CurrentDate ) - invoice date
>>
>> is not best?
>>
>> -  better to run a nightly server script - that finds invoices and fills a number field with that calc?
>>
>>
>> Thanks John - no I was not talking of this old function - sorry if I was confusing
>>> If you are referring to the "Today" function....don't use it!
>>
>>
>> Dave
>>
>>
>>
>>> On Mar 29, 2017, at 3:31 PM, Richard DeShong <[hidden email]> wrote:
>>>
>>> Hi Dave,
>>>
>>> This rule has not changed:  If you have a calc field that requires data from outside the current record, then you need a trigger to update it.
>>>
>>> For an accounting system, you should not rely on an auto-calc to perform aging.  You should create a script that reviews each invoice/statement and produces a report.
>>>
>>> For other types of daily/hourly/etc aging, stick with the server-side script.
>>>
>>>
>>> On 3/29/2017 2:26 PM, [hidden email] wrote:
>>>> Hi all,
>>>>
>>>> On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date
>>>>
>>>> Then you could perform calculations (like days overdue etc.) related to "today's date" from that field
>>>>
>>>>
>>>> Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )
>>>>
>>>>
>>>> --
>>>> Thanks,
>>>> Dave - DealTek
>>>> [hidden email]
>>>> [db-17]
>>>>
>>>> _______________________________________________
>>>> FMPexperts mailing list
>>>> [hidden email]
>>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>> --
>>> Richard DeShong
>>> Logic Tools
>>> 510-642-5123 office
>>> 925-285-1088 cell
>>>
>>> _______________________________________________
>>> FMPexperts mailing list
>>> [hidden email]
>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>
>> --
>> Thanks,
>> Dave - DealTek
>> [hidden email]
>> [db-17]
>>
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> --
> Richard DeShong
> Logic Tools
> 510-642-5123 office
> 925-285-1088 cell
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


--
Thanks,
Dave - DealTek
[hidden email]
[db-17]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

Bob Gossom
In reply to this post by dealtek@gmail.com
Dave,

If you use Get (CurrentDate) the calculation will be unstored. The real performance issue will come up over time as you get a lot of older invoiced that closed out years ago, but still need to be evaluated. For agings like this, we always use a “Closed” flag field that marks an invoice as closed (and therefore not relevant for an aging). This way you can do a stored find on the currently open invoices and only run the aging calc on them. Items can be marked closed in a number of ways; basically on an action (a payment is recorded the fully pays the item, or with a server script.

Bob Gossom
Absolute Advantage, Inc.

> On Mar 29, 2017, at 4:05 PM, [hidden email] wrote:
>
> Thanks so much for the info.
>
> Just so I am clear - if I want to do aging - then setting a number calc field like this:
>
> Get ( CurrentDate ) - invoice date
>
> is not best?
>
> -  better to run a nightly server script - that finds invoices and fills a number field with that calc?
>
>
> Thanks John - no I was not talking of this old function - sorry if I was confusing
>> If you are referring to the "Today" function....don't use it!
>
>
>
> Dave
>
>
>
>> On Mar 29, 2017, at 3:31 PM, Richard DeShong <[hidden email]> wrote:
>>
>> Hi Dave,
>>
>> This rule has not changed:  If you have a calc field that requires data from outside the current record, then you need a trigger to update it.
>>
>> For an accounting system, you should not rely on an auto-calc to perform aging.  You should create a script that reviews each invoice/statement and produces a report.
>>
>> For other types of daily/hourly/etc aging, stick with the server-side script.
>>
>>
>> On 3/29/2017 2:26 PM, [hidden email] wrote:
>>> Hi all,
>>>
>>> On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date
>>>
>>> Then you could perform calculations (like days overdue etc.) related to "today's date" from that field
>>>
>>>
>>> Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )
>>>
>>>
>>> --
>>> Thanks,
>>> Dave - DealTek
>>> [hidden email]
>>> [db-17]
>>>
>>> _______________________________________________
>>> FMPexperts mailing list
>>> [hidden email]
>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>
>> --
>> Richard DeShong
>> Logic Tools
>> 510-642-5123 office
>> 925-285-1088 cell
>>
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
>
> --
> Thanks,
> Dave - DealTek
> [hidden email]
> [db-17]
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Get ( CurrentDate ) with Calcs

dealtek@gmail.com
Thanks much Bob - That makes good sense!!!


> On Mar 31, 2017, at 9:33 AM, Bob Gossom <[hidden email]> wrote:
>
> Dave,
>
> If you use Get (CurrentDate) the calculation will be unstored. The real performance issue will come up over time as you get a lot of older invoiced that closed out years ago, but still need to be evaluated. For agings like this, we always use a “Closed” flag field that marks an invoice as closed (and therefore not relevant for an aging). This way you can do a stored find on the currently open invoices and only run the aging calc on them. Items can be marked closed in a number of ways; basically on an action (a payment is recorded the fully pays the item, or with a server script.
>
> Bob Gossom
> Absolute Advantage, Inc.
>
>> On Mar 29, 2017, at 4:05 PM, [hidden email] wrote:
>>
>> Thanks so much for the info.
>>
>> Just so I am clear - if I want to do aging - then setting a number calc field like this:
>>
>> Get ( CurrentDate ) - invoice date
>>
>> is not best?
>>
>> -  better to run a nightly server script - that finds invoices and fills a number field with that calc?
>>
>>
>> Thanks John - no I was not talking of this old function - sorry if I was confusing
>>> If you are referring to the "Today" function....don't use it!
>>
>>
>>
>> Dave
>>
>>
>>
>>> On Mar 29, 2017, at 3:31 PM, Richard DeShong <[hidden email]> wrote:
>>>
>>> Hi Dave,
>>>
>>> This rule has not changed:  If you have a calc field that requires data from outside the current record, then you need a trigger to update it.
>>>
>>> For an accounting system, you should not rely on an auto-calc to perform aging.  You should create a script that reviews each invoice/statement and produces a report.
>>>
>>> For other types of daily/hourly/etc aging, stick with the server-side script.
>>>
>>>
>>> On 3/29/2017 2:26 PM, [hidden email] wrote:
>>>> Hi all,
>>>>
>>>> On previous FileMaker versions sometimes we would write a server script that ran every night and updated a date field with the current date
>>>>
>>>> Then you could perform calculations (like days overdue etc.) related to "today's date" from that field
>>>>
>>>>
>>>> Q: Do we still need to do this or can we just create calc fields that use ... Get ( CurrentDate )
>>>>
>>>>
>>>> --
>>>> Thanks,
>>>> Dave - DealTek
>>>> [hidden email]
>>>> [db-17]
>>>>
>>>> _______________________________________________
>>>> FMPexperts mailing list
>>>> [hidden email]
>>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>>
>>> --
>>> Richard DeShong
>>> Logic Tools
>>> 510-642-5123 office
>>> 925-285-1088 cell
>>>
>>> _______________________________________________
>>> FMPexperts mailing list
>>> [hidden email]
>>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>>
>>
>> --
>> Thanks,
>> Dave - DealTek
>> [hidden email]
>> [db-17]
>>
>> _______________________________________________
>> FMPexperts mailing list
>> [hidden email]
>> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
>
> _______________________________________________
> FMPexperts mailing list
> [hidden email]
> http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au


--
Thanks,
Dave - DealTek
[hidden email]
[db-17]

_______________________________________________
FMPexperts mailing list
[hidden email]
http://lists.ironclad.net.au/listinfo.cgi/fmpexperts-ironclad.net.au
Loading...