Wordy title, yeah. So here’s the thing: I kept having to spin up tiny little Lightning Web Components (LWC) to show a message on a Lightning Record Page. A few of them I used an Apex controller to do some logic, or lookups, to determine if the message should be shown. But with the advent of Conditional Visibility for Lightning Record Page Components, I wanted to streamline as much as possible.
So here’s a simple solution for most use cases: A Lighting Record Page LWC that displays a configured message, and is shown or hidden based on Conditional Visibility! I’ll be able to reuse this in a number of different areas.
Just drop the “customErrorMessageForRecordPage” component into the page…
Type in the message that you want to display, and set Component Visibility!
BOOM! That’s all you need.
Note, the user must have Read access to the field in order for the visibility to be triggered.
Of course, this implementation is dead simple, so you can go to town with your own CSS, and perhaps passing in additional parameters at configuration time. Sky’s the limit!

Check out the code here: https://github.com/TheMadPope/custom-message-lwc-for-record-page
Happy Salesforcing!