Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

help creating a value list of possible DATES


This topic is 7453 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Does anybode know if there is a way to create a value list of dates?:.. I have a field called "Due date" which get's its value from the user. I would like to based on that field create a value list "pull down menu" that contains the calendar days from the current date up to 5 days before the due date. for example, If the due date is set to 7/15/04 then I would like the pull down menu to display 6/29/04, 6/30/04, 7/1/04, 7/2/04, 7/3/04, 7/5/04 ...... 7/10/04.

Anybody know how I can acomplish this??? is there a way to define value list using a loop or something like it???

I really apreciate any input

Posted

Well -

If you were using the Script-it plugin from CNS www.cnsplug-ins.com you can create XML menus (or popups) that can be scripted and created on the fly. A benefit of Script-it is you can also trigger a script from a choice of those dates.

Another option without a plugin would be to create a second database that has records for each user. When the user clicks on your field with the value list a script runs that goes to the related records for that user, deletes them and creates new date fields from the due date back x amount of days. The value list looks for related values in this second database based on a username relationship.

It is a start anyway!!

Posted

Thanks for the info!

Any chance that you can give me an idea of how to use the plug-in?: I downloaded a copy of it from the web page, and have gone through the literature included with it, but still can figure out how to use for my purpose??? (should I create a menu with the dates as options???)

I would apreciate any help

Posted

You could create two fields; ValueListDates ( a text field ),and TempDate ( A Date) and a script...

If Due Date < Status(CurrentDate)

Exit script ( or show message and exit script )

Set Field ValueListDates = DateToText(Status(CurrentDate))

Set Field TempDate = Status(CurrentDate)

Loop

Exit Loop If TempDate>= DueDate-5

Set Field TempDate= TempDate+1

Set Field ValueListDates = ValueListDates& "

Posted

This is where repeating calculation fields come in handy. No scripts are necessary, just an index field, constant, serial, calculation for the current repetition's date, and two relationships, one to look up the global index and a self-relationship based on the serial.

DueDate.zip

Posted

I am going to push my luck a bit further....Fist, thanks Robert Kidd for the help.... I almost got it to work... but there is one part I can figure out....I created the 2 field as you suggested, as well as a script (almost word by word from what you wrote), now I can figure out how to assign those values to my field.... let me explain.... I have the due date feild where the user enter the desiered date, no prob. but how do I get those values (the valuelistdates) to be the pull down menu for the field (I call that field the production date): I inserted the field "Valuelistdate" in my layout (as well as the TempDate field) to see what value it contained, and both of them have the right values....(the tempdate= due date- 5 days, and the valuelistdate contains everydate from today to due date - 5 days)...but I get lost on the part of setting the end field (the production date) to use those values values confused.gifconfused.gif.... you said something about setting the field as a button?:? any chance you could help me get to that next step??? (now that you have gotten me this far?:?

Pooh-Bah : unfortunately my FM knowledge is not advance enough to understand your answer (as is made clear by the type of questions that I make) any chance you could expand on it???

Thanks in advance...

P.S.: in case that nobody have told you guys lately, you guys are awsome.....real heroes yay.gif

Posted

In the sample that you posted(thanks again for the info), you use a scrip and several repeting field.... I think I have finally figure out how the repeting fields work, and I kind of understand the scrip (still working on the c.r.date one, but I'm sure I'll eventually get it).... my question are, first, how are you triggering the script?:? (I have copy the set up of you layout as far as I can see, but I can get it to activate when the d.due is entered), and also how are you controling the loop (I don't quiet understand how you are setting up the "end loop if" statement...... my gets stuck after one repetition (my x.n.index sets up as 5, and then stops (and obviously I don't get the dates I need in x.date)... could you explain????

thanks in advance

Posted

The script is only used to set the global index originally instead of manually typing 1, 2, 3, 4, 5, etc. into the appropriate repetitions (although in this case it would have started with 5 instead of 1). I should have removed it from the file to limit confusion. There are no scripts running, just the repeating calculation. The valuelist pulls its data from the self-relationship based on serial, using the repeating field calculation. Once that changes, the list auto-updates with the new data.

The global is only set once, then looked up when a new record is created, based on the constant-to-constant self-relationship. It is looked up because the results of the repeating calc must be indexed for the valuelist to work.

This topic is 7453 days old. Please don't post here. Open a new topic instead.

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
×
×
  • Create New...

Important Information

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