function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sivasankari MuthuSivasankari Muthu 

How to display alert window in Visualforcepage Onload?

Hi All,

I have one custom ( vf page) button for generate quote in opportunity Detail Page. Click this button it generate a custom quote in pdf format.
 In my Scenario, I click that quote button I want to check whether the quote object “IsSyncing"  field is checked or not, If its not checked I want to display one alert for "sync Quote" I am using Professional Edition.
 
Andrew EchevarriaAndrew Echevarria
Add this to your VF page between the <apex: page> tags
<script>
window.onload = function(){
    // Your desired action.
}
</script>

 
Sivasankari MuthuSivasankari Muthu
Hi Andrew ,
Thanks for your reply.
Its not working

 
Sivasankari MuthuSivasankari Muthu
Hi Andrew ,
Its working without give  renderAs="pdf".
But, I want the alert in pdf file only.
 
Andrew EchevarriaAndrew Echevarria
You'd have to do it in the controlled then, unfortunately when you render as PDF, the browser doesn't handle the VF page, just the final PDF, and as a result, no JS takes place.