Jump to content

How would you write this script for value defs?


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

Recommended Posts

I am working on a DB for employee tracking and I have a field called "Employee Status". I have a drop down of 5 items. 2 of wich are the words "Vacant" and "Contract".

If I select either of those two words, a second window pops up and asks for two date values that must be entered.

If I write a calculation for the "Employee Status" field and define as such. How should I modify my script to where it will bring up a second window that allows me to enter the Request Date and Expiration Date?

They can be both assigned the same because they both represent the same result if either is selected.

Let("Vacant" and "Contract" = 1),

If "Employee Status" = 1, Then open layout "Date menu"

Then the two dates would be entered, user would click OK, and close the window.

Simple, but what would be the best method to write this?

Link to comment
Share on other sites

I'm not sure what calc you want exactly.

When a value is selected from list, a button or a plug-in would lauch a script.

If[value = "Vacant" or value = "Contract"]

New Window...


Pause[ unknown]


Then your Button, would be set to "Continue" (not sure of the US translation for this) and will close the window.

Link to comment
Share on other sites

That makes sense. Good point!

The calc would be as described to validate if "Contract" or "vacant" were selected from the drop down list, to show the second window with the 2 date fields for entry and an ok button to close the window.

Your script example above works but the only issue is how to trigger it after data entry has been performed? In the validation tab for the field, it doesn't give you the option to validate by script unfortunately. frown.gif

Link to comment
Share on other sites

On Windows, you can define a field formatted as a menu as a button and run the appropriate function after a selection has been made. Remove the field from the Tab order so that users are forced to click on it. Use a script like

Allow User Abort [Off]

Go to Field [yourfield]

Pause/Resume script [1]

If [PatternCount( " vacant contract "; " " & Employee Status & " " )]

New Window


End If

Link to comment
Share on other sites

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