how to hide ‘Send SMS’ from Menu.
frm.page.menu.find(‘li:contains(“Send SMS”)’).hide();
i used this, but its not working.
frm.page.menu.find(‘li:contains(“Send SMS”)’).hide();
i used this, but its not working.
cur_frm.page.menu.find(`[data-label="${encodeURIComponent('Send SMS')}"]`).closest('li').remove();
its not getting hidden…
@anjalipv added in client script ?
yes, i already added this into client script.
on which client side event you have added this ?
i used this in both refresh and onload
share you code here @anjalipv
frappe.ui.form.on(‘Purchase Receipt’, {
refresh(frm) {
cur_frm.page.menu.find([data-label=“${encodeURIComponent(‘Send SMS’)}”]).closest(‘li’).remove();
},
onload(frm) {
cur_frm.page.menu.find([data-label=“${encodeURIComponent(‘Send SMS’)}”]).closest(‘li’).remove();
}
});
Please copy the given code, it’s working
cur_frm.page.menu.find(`[data-label="${encodeURIComponent('Send SMS')}"]`).closest('li').remove();
there is type on your code
jQuery
won’t work in Client Script
I think
@Antony_Praveenkumar It will, Working For me . The code given was tried and tested