You need to sign in to do that
Don't have an account?
sumanth v 18
Alert Box on Pick list value change on Case Object
I tried with this peace of code, whenever i change value alert appears but even reloading the page alert appears which shouldn't. How to skip alert on reloading the page.
<apex:page standardController="Case" rendered="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>
Also i tried in putting stage condition in action attribute but it is throwing Content cannot be displayed: SObject row was retrieved via SOQL without querying the requested field: Case.Stage__c [No Apex class associated to this page]
<apex:page standardController="Case" Action="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>
<apex:page standardController="Case" rendered="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>
Also i tried in putting stage condition in action attribute but it is throwing Content cannot be displayed: SObject row was retrieved via SOQL without querying the requested field: Case.Stage__c [No Apex class associated to this page]
<apex:page standardController="Case" Action="{!Case.Stage__c = 'Pending'}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:page>
Is the above snippet is a complete one. if no, please post comlete snippet.
If you only want a alert for stage pending, then update snippet with below: Hope this will help.
Please like the answer and mark it as best if this helps.
Thanks,
Aman
If you only want a alert for stage pending, then update snippet with below: YES
I tried your code it throws alert, also when i reload the page it throws alert which shouldn't.
I tried as per your comments too. I am able to get alert in above scenarios, issue is while refreshing the page also the alert fires which i need to stop.
<apex:page standardController="Case" rendered="{!If(Case.Stage__c = 'ADOPS: Miscellaneous request for Trafficking' ,true,false)}">
<script type="text/javascript">
window.alert("Static Content");
</script>
</apex:Page>
Can you post your code snippet
Thanks
<apex:page standardController="Case">
<script type="text/javascript">
var a = '{!Case.Stage__c}';
if(a == 'ADOPS: Miscellaneous request for Trafficking'){
window.alert("Static Content");
}
</script>
</apex:page>
How you actually updating case stage value?
When you want this alert to be popup?
As you are updating page from case detail layout. How would you want it to be fire?
would you like it to be fire automatically?
Thanks
I am updating in standard Case detail page, when the stage field got udpated with the mentioned value, alert should fire automatically
Alternative:
You could update stage from your custom vf page by using standard controller.
Thanks,
Aman
Thanks
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_std_actions.htm
Is above-mentioned solution working for you? Kindly let me know.
Thanks
Nope, we shouldn't create a custom button in our requirement. In above scenario we need to overide existing standard button.
Thanks
Sumanth