Custom Button notification (with badge) and redirect to another form, help !!!

I do something with notification badge on top of menu, the notification was made from button with bootstrap and with badge to show count for unread messages.
when user click the button, it should open grid form with my table.
But I couldn’t do this… please help
here is my code :

HTML Templates :

.navbar {
width: 50%;
margin-right: -8px;
.button__badge {
background-color: #fa3e3e;
border-radius: 2px;
color: white;
padding: 1px 3px;
font-size: 8px;
position: relative;
margin-top: 10px;
margin-right: 10px;
z-index: 9999;

<a href="'.{link1}.'"><button type='button' class='btn btn-primary btn-sm'> Notification <div class='button__badge' style='display: flex; justify-content: flex-end' > {jumlahnotif} </div></button></a>

And on Menu ->OnApplicationInit Event

<link rel="stylesheet" href="" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<script src="" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>
<script src="" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
<script src="" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script>

$count = 0;
$check_sql = "SELECT COUNT(*) AS COUNT_0 FROM tbnotif where fread=0";
sc_lookup(rs, $check_sql);

if ( {rs[0][0]} >= 0 ) // Row found
$count = {rs[0][0]};

{link1} = sc_make_link(brownotif);

pay attention to {link1} should make link to my grid .

but if I click the button, it show error.

Hi @imamgunawan, did you fix it?