lookup button for string

Hello! how I do so that when click on lookupbuttom of a field of type string leaves all the registries that field and when I choose one, the other fields fill up in form.

well, answer to the second pard of the question: there are two ways used most of all: if you want to fill a control - and it is not a field in your table, you would create a display method - that would ensure automatic update of its value in case you change the value in the string control. and if the field belongs to the datasoure(table) of the form, than you would overload the modifiedField method on the table, for example and set the values of the fields you want there, or you can overload the modified method on the datasource field (of your string control) and set values there. After that it would probably be a good idea to refresh the datasource. YourTable_ds.refresh(); and about “leaves all the registries that field” - what did you mean by this?

well, I now do not want to make a method display because I want to show fields of the same table. I have a table CIPerception with two fields: key,description; when associating to the ExtendedDataType “key” the key field of the table (relations) already it shows all the possible values to me that field that there is in the table. nevertheless in the field description it does not show anything to me after putting the properties correctly datasource and datafield. how is fixed this? Thanks!.

still don’t understand what you need. if I understood right, you have a table - you want to show it on the form. Or what? if you want to show all the values in a Grid, for example, and you say you set the properties, than my best guess is that you didn’t set them correctly. and if you simple have a field on a form - the key, you select a value using a lookup in it. and after selection you want to fill in the text in another control on this same form - description, than you would have to overload the modified method on this control (because your control is unbound to a datasource). And in the modified method you would write something like, Descrip_field (which is the name of the Description field on the form - and the property AutoDeclaration was set to yes). So, Descrip_field.text(CIPerception::find(key_field.valueStr()).Description); Something like this

Descrip_field.text(CIPerception::find(key_field.valueStr()).Description); this idea can be worth to me, only that gives the error me of which “find is not a class function”. How it would use the method filter of datasource CIperception in the method modified of the field? Thanks Ivan, because always answering my doubts!

you have to add the method Find to your table CIPerception - check how it is done in other tables - this method is present almost on each of the tables in the AOT. It returns a record based on the key field.