Hide Button On Form Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 09:36 PM
I'm trying to hide buttons on a form using a UI Action when the MTC field is False. I've tried several methods, but I haven't been successful yet.
This my Code
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 11:09 PM
Hello @yana7 ,
Please go into the Ui Action and in the related list you have Ui Action Visibility and Create a new entry there.
Set visibility as Exclude.
Please find the attachment.
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2024 11:58 PM
Hello @yana7 ,
Please refer below code, compare it with your existing code and update it accordingly:
function onLoad() {
// Check if the MTC field is false
if (g_form.getValue('mtc') === 'false') {
// Hide buttons using jQuery and g_form
$(g_form.getControl('sysverb_record_time')).hide();
$(g_form.getControl('assign_to_me')).hide();
$(g_form.getControl('sysverb_cancel')).hide();
g_form.removeOption('sysverb_record_time');
g_form.removeOption('assignToMe();');
g_form.removeOption('sysverb_cancel');
// Ensure to check if elements exist before trying to hide them
if ($$('#assign_to_me').length > 0) {
$$('#assign_to_me')[0].hide(); // Hide the top button
if ($$('#assign_to_me').length > 1) {
$$('#assign_to_me')[1].hide(); // Hide the bottom button as well
}
}
}
}
// Run the function when the form loads
onLoad();
If my solution helps you any way then mark it as accepted and helpful.
Thank You!!
Thank you!!
Dnyaneshwaree Satpute
Tera Guru