How to Show a Status Message in SharePoint 2013/2016?

Requirement: After the launch of the new SharePoint intranet portal, we wanted to display a status message on each page.

Solution: Here is the script to display a status message using the SharePoint JavaScript client-side object model.

<script type="text/javascript">
ExecuteOrDelayUntilScriptLoaded(AddStatusMessage, "sp.js");

function AddStatusMessage()
{
var statusID = SP.UI.Status.addStatus("Welcome","Welcome to New Crescent Portal. Feel free to contact <a href='mailto:support@crescent.com'>Helpdesk </a> if you have any queries");

SP.UI.Status.setStatusPriColor(statusID, 'green');
}
</script> 

And the result of the SharePoint 2013 status message:

sharepoint 2010 status message

This script can be used in Master pages or Script editor web parts.

Salaudeen Rajack

Salaudeen Rajack - Information Technology Expert with Two-decades of hands-on experience, specializing in SharePoint, PowerShell, Microsoft 365, and related products. He has held various positions including SharePoint Architect, Administrator, Developer and consultant, has helped many organizations to implement and optimize SharePoint solutions. Known for his deep technical expertise, He's passionate about sharing the knowledge and insights to help others, through the real-world articles!

Leave a Reply

Your email address will not be published. Required fields are marked *