Jump to content
Server Maintenance This Week. ×

Calculated Value List


jfaunce2

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

Recommended Posts

  • Newbies

I need to create a value list for a drop down to be able to choose the Graduation Year for students. I'd like the list to include: this year, this year +1, this year + 2, and so forth. I don't want to do fixed values since list will advance each year.

 

Thank you

Link to comment
Share on other sites

You can write a script that is executed OnFirstWindowOpen (or is called by another, generic start script) and compares the values of a stored field in a one-record Control table with the contents it should have based on the current date, and updates its contents if they differ.

Go to Layout [ Control ( Control ) ]
Set Variable [ $yearList ; 
Let ( 
y = Year ( Get ( CurrentDate ) ) ;
List ( y ; y + 1 ; y + 2 /* andSoForth */ )
)
]
If [ Control::yearList ≠ $yearList ]
  Set Field [ Control::yearList ; $yearList ]
End If

Base your value list on that field. OTOH …

 

I don't want to do fixed values since list will advance each year.

 

… that's once (1x) a year. Posting this message, reading the replies and implementing this or any other suggested method will probably eat up any savings in time you could ever hope to gain by automating this process. But then of course, we're programmers …  :laugh: 

 

Year(GetCurrentDate) I believe . . . +1, +2 etcetera.

 

The problem I see: if you index that, it won't update; if you don't index it …

  • Like 1
Link to comment
Share on other sites

  • Newbies

Thanks. I agree that manually updating is quick (and I've spent too much time on this already), but I'm 72 and may not work forever at school. Will someone else update? Who knows.

 

Yes, indexing is the problem. I created a list value, but FM whined that it wouldn't index.

Link to comment
Share on other sites

This topic is 3571 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.