Jump to content
Sign in to follow this  
bac mac

Autoenter date series in repeating field?

Recommended Posts

I need to autofill a repeating field with the dates for a particular week dependent on the the number of the week in the year (in a different field).

1. It works when I do this via a script, but is there a way to autoenter a calculation into each member of the repeating field?

2. Alternatively, is there a way to get a script to autoexecute when New Record is selected from the menu?

Thank you,

Bruce

Share this post


Link to post
Share on other sites

I don't think it's possible - but you could use a repeating calculation field, instead of auto-enter.

Why do you need this?

Share this post


Link to post
Share on other sites

Well it's posible, but I'm as Michael pretty sure you're barking up the wrong tree here. Fully normalized calendaring systems ought to follow a structure in the vicinity of this:

http://www.fmforums.com/forum/showtopic.php?tid/176396/post/204083/hl//fromsearch/1/

Frankly speaking are any other approaches, daft quixotic endevours!

Repeaters are only for utility purposes!!!!! ....and here might the scenario be a sans-jointable many 2 many. But with your version is multicriteria relationships posible both from an autoenter and a calc'field.

Daniele's Extend( trickery can be used here, although we were scatching our heads as to where to deploy it at all ...further more is there an error message when you insist on the autoenter should be of type date... therefore must an unstored calc'field be there to translate the stored format into the OS pref. date format.

I attach the template, well knowing that you would abuse the technique ...but perhaps is it the best way to dissuade people, if you deliberatly let them paint themselves into a corner???

But please do not come and say you weren't warned off propperly!

--sd

daftasabrush.zip

Share this post


Link to post
Share on other sites

You say it's possible, but I don't see it in your file. You too are using a calculation field, and what's worse, you force a structure of exactly one record per week.

I am guessing the purpose is to create a value list showing dates from the week of record's creation. This could be done simply by a repeating calculation field =


Let ( [

today = Extend ( CreationDate ) ;

sat = today - DayOfWeek ( today )

] ;

sat + Get ( CalculationRepetitionNumber ) 

)

Share this post


Link to post
Share on other sites

I appreciate all the advice.

The example worked fine and is MUCH shorter than my script solution.

I didn't realize you could use days since the year 1 that way. It is not mentioned in the Help for the GetAsDate function (at least in 8.5 I'm running on my laptop).

The repeating field is just for display purposes so I THINK I'm safe.

Its for a time sheet where the hours worked, annual, sick, etc., can be entered in a separate repeating field. Then another field accumulates the total and there will be normal processing to generate the stub kinds of information- leave used, balances, etc., all linked to the pay period week, or perhaps biweekly pay period.

Thanks very much,

Bruce

Share this post


Link to post
Share on other sites

ts for a time sheet where the hours worked

This is the purest form of violation of 1NF...

The repeating field is just for display purposes so I THINK I'm safe

You're most certainly not, with utility purposes as such do I mean invisible to the user such as relational keys, or sliding objects when printing.

Please do read up on relational approaches. Snap out of the spreadsheet'ish metaphors.

--sd

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use.