This topic is locked

Lookup Table Option

5/4/2011 5:38:38 AM
PHPRunner General questions
H
horsey_kim author

I use the lookup wizard all the time. Here is one example of how I might use it. Often I will have a several field dependent on another's table field. This is a very cool feature. I was wondering could you put a drop down box with a size feature. It would need to limit what you see on the add or edit screens (or inline add/edit), but it would still take the whole value from the other tables field and put it in the database without restricting the length of the field. I know I did not explain this well, here is my example:
TABLE 1 is called CLASS

Fields in this table are CLASSNAME, FACILITY, ADDRESS, DIRECTIONS, TIME, DATE, PHONE, EMAIL, INSTRUCTOR
TABLE 2 is called LOCATION

fields in this table are FACILITY, DIRECTIONS, MAPPING, ADDRESS
The field DIRECTIONS is a mediumtext field because it often exceeds 254 characters.
If in table CLASS, I use the lookup wizard dependent feature to auto fill the ADDRESS and DIRECTIONS based on the FACILITY, the DIRECTIONS field is so long and pushes the screen out. But if we could set a size to the drop down choice, and not see the entire directions, then it would fit nicely in the screen. However we would need the whole value of the field to go in the database and it not be sized. The size feature is just a visual restriction on the screen (similar to what we do with text fields and areas)
Thanks for listening,
Kim

Sergey Kornilov admin 5/4/2011

You can use a custom display expression. Field can be truncated using MySQL's Left() function:

http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_left
You can use something like this:

left(DIRECTIONS,50)
H
horsey_kim author 5/8/2011



You can use a custom display expression. Field can be truncated using MySQL's Left() function:

http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_left
You can use something like this:

left(DIRECTIONS,50)



Did not work. I tried all the below in the custom display, none worked.
left($data["directions"],20);
left($data["directions"],20)
left(directions,20);
left(directions,20)
I don't know if this is a factor but this fields are being generated from a dependent field.
here is what my settings are:


It would be great if there was a size feature under the required field check box.
thanks for listening.