Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<apex:page controller="ConvertPageMessagesController" >
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<apex:slds />
<style>
.msgIcon {
display: none!important
}
.customMessage * {
color: #fff!important
}
.customMessage {
margin: 5px 0!important;
max-width: 1280px;
opacity: 1!important;
width: 100%;
font-size: 12px;
border: 0px;
padding-left: 10px;
}
.message {
opacity: .1
}
</style>
<script>
$(document).ready(function(){
overridePageMessages();
});
function overridePageMessages(){
var textureEffect = '';
//Uncomment below line for texture effect on page messages
//textureEffect = 'slds-theme--alert-texture';
$('.warningM3').addClass('slds-notify slds-notify--toast slds-theme--warning customMessage '+textureEffect);
$('.confirmM3').addClass('slds-notify slds-notify--alert slds-theme--success customMessage '+textureEffect);
$('.errorM3').addClass('slds-notify slds-notify--alert slds-theme--error customMessage '+textureEffect);
$('.infoM3').addClass('slds-notify slds-notify--toast customMessage '+textureEffect);
$('.errorM3').removeClass('errorM3');
$('.confirmM3').removeClass('confirmM3');
$('.infoM3').removeClass('infoM3');
$('.warningM3').removeClass('warningM3');
}
</script>
<apex:pagemessages/>
</apex:page>
/*
Description: This class is creating dummy page messages.
*/
public class ConvertPageMessagesController{
public ConvertPageMessagesController(){
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.FATAL,'Please enter Account name'));
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Please enter Account number'));
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter Account phone'));
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.INFO,'Please enter Account site'));
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.CONFIRM,'Please enter Account industry'));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.