Jump to content
Server Maintenance This Week. ×

Time-range based field entry


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

Recommended Posts

Hello and thanks!

When my file opens a script is run which creates a new blank record and populates a field with the Date of creation.

What I need is a second field to be populated a certain way based upon a time range from the date created field.

example:

If the record is created between 07:45 AM and 08:15 AM, then a field named "SHIFT" will be populated with text that says "Dayshift - 0800-1600".

Is this possible? Thanks again.

Edited by Guest
Link to comment
Share on other sites

there are probably any number of ways to do that and i'm sure someone here will come up with something really elegant.

if you just have a few of those shift slots, it might be easy to just use a second field which auto-enters the creation time. it doesn't need to be on the layout. then, in your script, you can have a case statement like this:

case (

timeIn > time (7,44,00) and timeIn < time (8,15,00, "Dayshift - 0800-1600"),

[similar expressions for more shifts],

NightSift - 2300-0800")

Edited by Guest
Link to comment
Share on other sites

Thanks so much for taking the time. I will try your idea. I actually have created the "Time created" field and it is not in the layout. I figured I would need to have it for the script but I am new enough to scripting that I don't know how to write it.

Thanks again. I will let you know.

B

Link to comment
Share on other sites

I guess I have a lot of learning to do yet. When I tried it, I got a popup message that said "The specified file cannot be found".

I'm lost.

Unless one of you can guide me through the actual process, I think I should do some more reading because I may have the cart before the horse.

Thaks again

B

Link to comment
Share on other sites

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