showFieldMsg is not working in workspace
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-23-2024 11:55 PM
Hi,
I'm trying to show field msg in workspace using g_form.shoFieldMsg() after clearing the value, the value is getting cleared but the message stays for a fraction of second and disappears. Please suggest how to fix this issue.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā07-24-2024 12:36 AM - edited ā07-24-2024 12:40 AM
Hello @Sri_9 , Please elaborate your issue.
If i am able to understand your issue, check that is there any ui policy/script that is setting the required field hidden?
Thank you!!
Dnyaneshwaree Satpute
Tera Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-26-2025 07:11 AM
Hi @Sri_9 , did you ever find solution for this issue? Thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-26-2025 07:40 AM
The problem occurs because when you use g_form.clearValue(), the form might be refreshed or re-rendered almost immediately, which results in the message disappearing right after being shown. By adding a slight delay before clearing the value, you can give the message enough time to stay visible.
var test = g_form.getValue('u_test');
var regex = /^[^, ]+$/;
if (test != '' && !regex.test(test)) {
g_form.showFieldMsg('u_test', 'Please enter a valid value', 'error');
setTimeout(function() {
g_form.clearValue('u_test');
}, 100);
}
By adding this delay, you prevent the message from disappearing too quickly when the value is cleared.
If this works for you, kindly accept this solution and give it a thumbs up.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-26-2025 07:49 AM
Thank you @uttkarshupa! , it seems like a Workspace issue, as it works properly at the backend view.
I'm looking for a solution that will keep the error message permanently...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ā01-26-2025 07:57 AM
You're welcome! Yeah, it seems like a Workspace issue. If you're looking to keep the error message permanently, try using the persist option with g_form.showFieldMsg() (if available). This should keep the message until you manually remove it. Let me know if that works for you.