Using a Hyperlink to select a subfile entry
Start Point
The shipped aXes demonstration screen named XHRRPGTRN_Select is used.
The subfile selection column is field named Sel and the employee number column is named Employee:
Result
The selection column is still visible, but an employee can be selected and displayed by clicking on the employee number hyperlink:
Steps
- The employee column was selected and changed to be a Hyperlink.
- These properties were then set in the hyperlink eXtension:
caption (script):
ENV.returnValue = FIELD.getValue();
style
Cursor: Hand
Text-decoration: underline
onClick (script)
/* Find out the subfile index of this field (the one clicked on) */
var iSFLIndex = FIELD.getIndex();
/* Get a reference to the "Sel" field with the same subfile index */
var oSel = FIELDS("Sel",iSFLIndex);
/* If found, set the "Sel" field to "X" and press Enter */
if (oSel != null)
{
oSel.setValue("X");
SENDKEY("Enter");
}
mouseOverColor
blue