!--a11y-->
Writing Code for Hyperlinks 
This example shows how to make a hyperlink context-sensitive, linking to different hyperlink targets depending its content at the time it is chosen. To implement this functionality, you must write code for the hyperlink to determine which hyperlink target to be displayed.
The Order Details tile has a hyperlink source associated with its Name control. Depending on the data displayed in the Name field at runtime, the hyperlink source must display one of two tile sets when it is chosen.
· If a business partner’s name appears in the Name field, the Business Partner Details tile set is to be displayed.
· If a contact person’s name appears in the Name field, the Contact Person Details tile set is to be displayed.
To implement this, the following code example queries the field’s content (contained in the src variable) to determine which tile set target is to be used. If the field contains the string CAP, the hhypCAPOview tile set appears. If the field contains the string CON, the hhypCONOview tile set appears.
If UCase(src) = "CAP" Then
ctrlPartnerName.hlActivate "hhypCAPOview"
Set mCONQueryObj = gFactory.NewBusinessQuery("BSCAPGEN")
mCONQueryObj.sfakna1 = key
Set mCONCol = mCONQueryObj.query
If mCONCol.Count > 0 Then
hhypCAPOview.setRawContent mCONCol
End If
ElseIf UCase(src) = "CON" Then
ctrlPartnerName.hlActivate "hhypCONOview"
Set mCONQueryObj = gFactory.NewBusinessQuery("BSCONGEN")
mCONQueryObj.sfakna1 = key
Set mCONCol = mCONQueryObj.query
If mCONCol.Count > 0 Then
hhypCONOview.setRawContent mCONCol
End If
End If