Let's say I have one field called "Em_Status" (employee status). This field is numeric
Now, I want to create a value list with theses values
Active
Inactive
Cancelled
The user must select the right status, and the data in the
"Em_Status" field must be 1 (Active) or 2 (Inactive) and so on. I don't want to register the word "Active" or the word "Inactive" in the field Em_status
Cooler would be if you could replace your original data with the formatted data, Active by 1 Inactive by 2 etc in the same field.....
Want to go for that ?
Let’s try it...
You need 5 fields :
Em_State , look-up by valuelist
Em_Mask_cn, calc with Case statement
serial_n, auto enter autonumber, increment 1
modTime, modification time
serialTrigger_cn, Case(modTime; serial_n; serial_n)
and a self relationship, serialTrigger_cn ::serial_n
The key to this solution is a lookup. The field you want to be formatted will be the lookup. In this case, that field is the Em_State field. The only drawback is you need to exit the record by typing the Enter key on the numeric keypad or moving to another record, you can’t just tab to another field. So it depends how your interface/layout is built.
The lookup is based on the match between the serialTrigger_cn and the serial_n field.
Any time the modTime field changes, the calculation reevaluates. The modTime auto-enters the modification time. That means the time updates everytime the record is exited, if a change has been made to a field on the record. Since the calculation returns the serial_n value whether the result is true or false, the calculation value does not actually change. However, the reevaluation of the calculation is enough to trigger the lookup. The lookup is then able to grab the filtered Em_State from the Em_Mask_cn field.
If you want a samplefile leave a mailaddress....
It's a lot simpler to set up a separate file holding just three records of two fields. The fields are StatNum (Contents are 1, 2 and 3) and StatText (Contents Active,Inactive and Cancelled.)
Define the valuelist as from that file. You can show both fields.
I think that, in V7, you can use a table to do the same.
In a way you're right Paul, and I use that technique too.
I wanted to 'kill 2 birds with one stone' since Nro seems to be a new user.
To show that there are more than one solution in FM,more 'things' to use, some calculations, case statement, layout tricks etc...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.