There are a few approaches you can consider.
If you want to stick with a MENU, then you can make the fields a BUTTON using the presentation style buttonType=link, and use the ui.Form.setElementText method to render the field value (in your example the customer code and/or name) as the button text. This will display the value with an underline like a link and provide a hint to the end-user they can click on this field and something will happen
So something like 4gl
CALL ui.Window.getCurrent().getForm().setElementText("detail1",rec.field1)
CALL ui.Window.getCurrent().getForm().setElementText("detail2",rec.field2)
CALL ui.Window.getCurrent().getForm().setElementText("detail3",rec.field3)
MENU ""
ON ACTION detail1
CALL FGL_WINMESSAGE("Info", SFMT("Detail clicked in field %1", "field1"),"info")
ON ACTION detail2
CALL FGL_WINMESSAGE("Info", SFMT("Detail clicked in field %1", "field2"),"info")
ON ACTION detail3
CALL FGL_WINMESSAGE("Info", SFMT("Detail clicked in field %1", "field3"),"info")
END MENU
Form
GRID
{
Field1 [f01 ]
Field2 [f02 ]
Field3 [f03 ]
}
END
END
ATTRIBUTES
BUTTON f01 : detail1, STYLE="link";
BUTTON f02 : detail2, STYLE="link";
BUTTON f03 : detail3, STYLE="link";
and 4st
<Style name="Button.link">
<StyleAttribute name="buttonType" value="link" />
</Style>
if you don't mind using an INPUT then you also can use a NOTEDITABLE BUTTONEDIT. This will display the value and have a small button to the right of the field the user can click on to get detail or drill down
INPUT BY NAME rec.* ATTRIBUTES(WITHOUT DEFAULTS=TRUE)
ON ACTION detail
CALL FGL_WINMESSAGE("Info", SFMT("Detail clicked in field %1", FGL_DIALOG_GETFIELDNAME()),"info")
END INPUT
GRID
{
Field1 [f01 ]
Field2 [f02 ]
Field3 [f03 ]
}
END
END
ATTRIBUTES
BUTTONEDIT f01 = formonly.field1, ACTION=detail, NOTEDITABLE;
BUTTONEDIT f02 = formonly.field2, ACTION=detail, NOTEDITABLE;
BUTTONEDIT f03 = formonly.field3, ACTION=detail, NOTEDITABLE;
A more complex technique if you are using GBC and/or Universal Rendering would be to explore some customisation that uses the onClick Javascript event (or onDblClick or onMouseOver etc) for the field/widget that sends the action back. However you would not want to get in the way of the existing events that move focus to the field in an INPUT etc)
What you also have to note is that a MENU has no concept of current field. So note in the above examples, the MENU example using a BUTTON has a different action for each field, whilst the INPUT example is able to use a single ON ACTION and FGL_DIALOG_GETFIELDNAME() to determine what the 4gl field focus is. I am also conscious that none of those techniques allow you to share a form between an input view and a readonly view.
Reuben