Print Button function in Salesforce

Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
1
down vote
favorite
I have created a print button and passed following javascript method :-
When I am clicking on the button Print I am getting below error:-
Please help.
Thank you.
apex javascript
add a comment |Â
up vote
1
down vote
favorite
I have created a print button and passed following javascript method :-
When I am clicking on the button Print I am getting below error:-
Please help.
Thank you.
apex javascript
1
Hi @vidya you can't use apex code on Custom button. This code only use on Visualforce pages.
â Prem Anandh
11 hours ago
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have created a print button and passed following javascript method :-
When I am clicking on the button Print I am getting below error:-
Please help.
Thank you.
apex javascript
I have created a print button and passed following javascript method :-
When I am clicking on the button Print I am getting below error:-
Please help.
Thank you.
apex javascript
asked 11 hours ago
vidya
82
82
1
Hi @vidya you can't use apex code on Custom button. This code only use on Visualforce pages.
â Prem Anandh
11 hours ago
add a comment |Â
1
Hi @vidya you can't use apex code on Custom button. This code only use on Visualforce pages.
â Prem Anandh
11 hours ago
1
1
Hi @vidya you can't use apex code on Custom button. This code only use on Visualforce pages.
â Prem Anandh
11 hours ago
Hi @vidya you can't use apex code on Custom button. This code only use on Visualforce pages.
â Prem Anandh
11 hours ago
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
you did everything correct except the code you added in the text area.
Visualforce code can't be executed here. Only javascript code will be executed here
You have to just need window.print();
Just put this in text box and try
Thank you.It worked . :)
â vidya
10 hours ago
add a comment |Â
up vote
1
down vote
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.

add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
you did everything correct except the code you added in the text area.
Visualforce code can't be executed here. Only javascript code will be executed here
You have to just need window.print();
Just put this in text box and try
Thank you.It worked . :)
â vidya
10 hours ago
add a comment |Â
up vote
2
down vote
accepted
you did everything correct except the code you added in the text area.
Visualforce code can't be executed here. Only javascript code will be executed here
You have to just need window.print();
Just put this in text box and try
Thank you.It worked . :)
â vidya
10 hours ago
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
you did everything correct except the code you added in the text area.
Visualforce code can't be executed here. Only javascript code will be executed here
You have to just need window.print();
Just put this in text box and try
you did everything correct except the code you added in the text area.
Visualforce code can't be executed here. Only javascript code will be executed here
You have to just need window.print();
Just put this in text box and try
answered 11 hours ago
Ratan Paul
18.6k82463
18.6k82463
Thank you.It worked . :)
â vidya
10 hours ago
add a comment |Â
Thank you.It worked . :)
â vidya
10 hours ago
Thank you.It worked . :)
â vidya
10 hours ago
Thank you.It worked . :)
â vidya
10 hours ago
add a comment |Â
up vote
1
down vote
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.

add a comment |Â
up vote
1
down vote
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.

add a comment |Â
up vote
1
down vote
up vote
1
down vote
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.

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.

answered 11 hours ago
Prem Anandh
1066
1066
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsalesforce.stackexchange.com%2fquestions%2f227835%2fprint-button-function-in-salesforce%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
Hi @vidya you can't use apex code on Custom button. This code only use on Visualforce pages.
â Prem Anandh
11 hours ago