Please find below the code for review -
Kindly suggest where the code needs refinement.
Also, as an alternate solution tried Calculated columns (value set to Numeric) and provided the required hyperlink information in the formula section. The hyperlink appears in
Allviews.aspx, but not visible in