You need to sign in to do that
Don't have an account?
Ganesh Rajput
this visualforce page is added to listview button controller performing mass action, I have to display toast depending on success or failure
all things are done just need call this script functions.
calling javascript from visualforce
<apex:page standardController="RFQ__c" recordSetVar="RFQ" lightningStylesheets="true" showHeader="false" standardStylesheets="false" sidebar="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0" action="{!genrateRFQQoute}" extensions="QuoteCreatorController"> <apex:form > <apex:pageBlock title="Create Quotes" mode="maindetail"> <center> <apex:outputLabel rendered="{!ifSuccess}" style="color:Green"><H3> <!-- Calling success toast--> </H3></apex:outputLabel> <apex:outputLabel rendered="{!ifError}" style="color:red"><H3> <!-- Calling error toast --> </H3></apex:outputLabel> </center> </apex:pageBlock> </apex:form> <apex:slds /> <script> function toastSuccess() { sforce.one.showToast({ "title": "Success!", "key": 'info_alt', "type": "success", "message": "Sucess message !!!" }); }, function toastError() { sforce.one.showToast({ "title": "Success!", "key": 'info_alt', "type": "error", "message": "Error message !!!" }); } </script> </apex:page>calling toast functions dynamically
this visualforce page is added to listview button controller performing mass action, I have to display toast depending on success or failure
all things are done just need call this script functions.
All Answers
If this answer helps you, please mark it as accepted.
Regards,
Tushar Sharma
https://newstechnologystuff.com/
<apex:outputpanel rendered="{!ifSuccess}" style="color:Green">
<script>
sforce.one.showToast({
"title": "Success!",
"key": 'info_alt',
"type": "success",
"message": "Sucess message !!!"
});
</script>
</apex:outputpanel>
<apex:outputpanel rendered="{!ifError}" style="color:red">
<script>
sforce.one.showToast({
"title": "Success!",
"key": 'info_alt',
"type": "error",
"message": "Error message !!!"
});
</script>
</apex:outputpanel>