Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
When I am clicking on the button Print I am getting below error:-
you did everything correct except the code you added in the text area.
You just need window.print();
Just put this in text box and try
You can't use apex tags in custom java script buttons. Just use window.print(); in your custom button it will automatically redirect you to print page.
Required, but never shown