Booyah Posted May 12, 2009 Posted May 12, 2009 (edited) 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 May 12, 2009 by Guest
stefangs Posted May 12, 2009 Posted May 12, 2009 (edited) 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 May 12, 2009 by Guest
Booyah Posted May 12, 2009 Author Posted May 12, 2009 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
Booyah Posted May 12, 2009 Author Posted May 12, 2009 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
Recommended Posts
This topic is 5674 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 accountSign in
Already have an account? Sign in here.
Sign In Now