Thanks for the response @reptar
But it wont work this will only work for client script in which user interface involved , I am trying to find a workaround in which we can perform button functionality on userevent (Server side) level , where we dont have any user interface