Referring a Field by a Text Label (from Object Library)

I search Fields by a simple procedure with a mouse click on a Text Label that has a Procedure associated with it.

  • Field “Field Name”
    FindSelect

I put this procedure within the Text Label but for every different Field I must put the Field Name in.

Is there a way for a generic procedure that when I click on the Text Label it goes to that Field that has the same name and then executes the Find/Select for the Field that has the same name as the Text Label?

Explaining it another way when I click on the Text Label the procedure says to itself:

  • He wants to Find/Select on a Field that has the same name as the Text Label.

    Do it.

That way I have a procedure that I can imbed into any Text Label with no modifications and the simple procedure will work as long as the Text Label has the same name as the Field.

Here’s a procedure that will do what you want.

field objectinfo("$TextLabelContent",info("clickedobjectid") )
findselect

You could embed this code into every button, but I think a better approach would be to make a named procedure with this code, and then use a call statement within each button to call the procedure. For example if you called the procedure LabelFindSelect, you could put this code into each button:

call LabelFindSelect

Thanks Jim.

Works like a charm.