function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sam1980Sam1980 

Hide a Form and Buttons on Warning Messages

As per the image below is it possible to catch the warning message and Hide the button and the form below it ? How do i do it ?

User-added image
Best Answer chosen by Sam1980
Grazitti TeamGrazitti Team
Hi Sach,

Please follow these steps:

1. Use a boolean variable isRecord in controller. Set it's value to True in constructor
2. Please check the error message string in controller. If it contains text warning "No Record Found" then set isRecord variable value to false.
3.  Use this flag value to render the section below warning message using property rendered="{!isRecord}"

Please mark this as best answer if it answers your question, it helps others.

Thanks!

All Answers

Grazitti TeamGrazitti Team
Hi Sach,

Please follow these steps:

1. Use a boolean variable isRecord in controller. Set it's value to True in constructor
2. Please check the error message string in controller. If it contains text warning "No Record Found" then set isRecord variable value to false.
3.  Use this flag value to render the section below warning message using property rendered="{!isRecord}"

Please mark this as best answer if it answers your question, it helps others.

Thanks!
This was selected as the best answer
Sam1980Sam1980
Thanks will check your suggestion