You need to sign in to do that
Don't have an account?
Shubham Sinha 56
Popup alert through Visualforce Page.
Hi,
I have developed a Vf page in which I am showing an alert when a lead status is changed to 'Working'. It is working fine but everytime I open that record I see the alert but my requirement is to show only for once when a status is changed to working. How to do that.
I have developed a Vf page in which I am showing an alert when a lead status is changed to 'Working'. It is working fine but everytime I open that record I see the alert but my requirement is to show only for once when a status is changed to working. How to do that.
<apex:page standardController="Lead" lightningStylesheets="true" rendered="{!Lead.Status ='Working'}"> <script type ="text/javascript"> { window.alert("Your lead is now in ‘Working’ status. You have 5 business days to progress"); } </script> </apex:page>
It looks like the VF page is working as designed or intended,but when it comes to rerendering it based on previous value, we may need to take help of Apex and check if the value was actually changed on re-render and based on it the alert can be shown or similar logic can be tried to attempt. If the previous values of status field is same is the current then the alert should not be shown as required.
Similar attempts have been already discussed over below threads, if you wish to check with alternatives by the community members:
https://developer.salesforce.com/forums/?id=9060G000000BfTQQA0
https://developer.salesforce.com/forums/?id=9060G000000MUyKQAW
http://pranavmarathe.blogspot.com/2011/06/simple-pop-up-alert-in-salesforce.html
Hope above information helps. Please mark as Best Answer so that it can help others in future.
Thanks.
Hi Subham,
Please try the below code.